Browse Source

Added CTCP logging to file.

tags/3.1.0
Teknikode 4 years ago
parent
commit
2f8d8e4ef0
1 changed files with 12 additions and 0 deletions
  1. 12
    0
      Modules/Logging/Logging.cs

+ 12
- 0
Modules/Logging/Logging.cs View File

@@ -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…
Cancel
Save