// Fires when a message is received that is prefixed with an ! public static void chatOnCommand(object sender, TwitchLib.TwitchChatClient.OnCommandReceivedArgs e) { ChatFiltering.violatesProtections(e.ChatMessage.Username, Common.isSub(e), Common.isMod(e), e.ChatMessage.Message); Commands.handleChatCommand(e); processPotentialSub(e); Common.ChatMessageTracker.addMessage(e.ChatMessage); }
// Fires when a chat message is received from chat client public static void chatOnMessage(object sender, TwitchLib.TwitchChatClient.OnMessageReceivedArgs e) { if (e.ChatMessage.Message[0] != '!') { if (showRawIRC) { Console.ForegroundColor = ConsoleColor.Cyan; Common.message(string.Format("MESSAGE {0}", e.ChatMessage.RawIrcMessage)); } else { Common.message(string.Format("MESSAGE {0}: {1}", e.ChatMessage.DisplayName, e.ChatMessage.Message)); } } if (Common.Raffle != null && Common.Raffle.raffleIsActive()) { Common.Raffle.addEntry(e.ChatMessage.Username, e.ChatMessage.Message); } ChatFiltering.violatesProtections(e.ChatMessage.Username, Common.isSub(e), Common.isMod(e), e.ChatMessage.Message); if (Common.AhoyRewarder.isActive()) { Common.AhoyRewarder.processMessage(e); } processPotentialSub(e); Common.ChatMessageTracker.addMessage(e.ChatMessage); }