소스 검색

Added CTCP logging to file.

tags/3.1.0
Teknikode 4 년 전
부모
커밋
2f8d8e4ef0
1개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  1. 12
    0
      Modules/Logging/Logging.cs

+ 12
- 0
Modules/Logging/Logging.cs 파일 보기

@@ -23,6 +23,8 @@ namespace Combot.Modules.Plugins
logLock = new ReaderWriterLockSlim();

Bot.IRC.ConnectEvent += AddServer;
Bot.IRC.Message.CTCPMessageReceivedEvent += LogCTCPMessage;
Bot.IRC.Message.CTCPNoticeReceivedEvent += LogCTCPNotice;
Bot.IRC.Message.ChannelMessageReceivedEvent += LogChannelMessage;
Bot.IRC.Message.PrivateMessageReceivedEvent += LogPrivateMessage;
Bot.IRC.Message.ChannelNoticeReceivedEvent += LogChannelNotice;
@@ -78,6 +80,16 @@ namespace Combot.Modules.Plugins
LogToFile(SERVERLOGNAME, notice.TimeStamp, string.Format("<{0}> {1}", notice.Sender.Nickname, notice.Message));
}

private void LogCTCPMessage(object sender, CTCPMessage message)
{
LogToFile(SERVERLOGNAME, message.TimeStamp, string.Format("<{0}> CTCP {1} {2}", message.Sender.Nickname, message.Command, message.Arguments));
}

private void LogCTCPNotice(object sender, CTCPMessage notice)
{
LogToFile(SERVERLOGNAME, notice.TimeStamp, string.Format("<{0}> CTCP {1} {2}", notice.Sender.Nickname, notice.Command, notice.Arguments));
}

private void LogChannelJoin(object sender, JoinChannelInfo info)
{
if (!ChannelBlacklist.Contains(info.Channel)

Loading…
취소
저장