protected override void OnMessage(TwitchIrcChannel channel, TwitchChannelUser from, string message) { var userMessage = new UserMessage(channel, from, message); ReceivedMessages.Add(userMessage); //TODO: If user is either opted out or blacklisted, return void here. //If a user message can be parsed into a command, print a reply message and ignore everything else. foreach (var command in _commands) { if (command.Parse(userMessage)) { try { ExecuteCommand(command, userMessage); } catch (Exception ex) { var x = ex; } return; } } }
protected override void OnClear(TwitchIrcChannel channel, TwitchChannelUser from = null) { // }
protected override void OnAction(TwitchIrcChannel channel, TwitchChannelUser from, string message) { //Treat the same as messages. OnMessage(channel, from, message); }
public UserMessage(TwitchIrcChannel channel, TwitchChannelUser from, string message) { Channel = channel; From = from; Message = message; }