Exemple #1
0
        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;
                }
            }
        }
Exemple #2
0
        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;
                }
            }
        }
Exemple #3
0
 protected override void OnClear(TwitchIrcChannel channel, TwitchChannelUser from = null)
 {
     //
 }
Exemple #4
0
 protected override void OnAction(TwitchIrcChannel channel, TwitchChannelUser from, string message)
 {
     //Treat the same as messages.
     OnMessage(channel, from, message);
 }
Exemple #5
0
 public UserMessage(TwitchIrcChannel channel, TwitchChannelUser from, string message)
 {
     Channel = channel;
     From    = from;
     Message = message;
 }
Exemple #6
0
 public UserMessage(TwitchIrcChannel channel, TwitchChannelUser from, string message)
 {
     Channel = channel;
     From = from;
     Message = message;
 }
Exemple #7
0
 protected override void OnAction(TwitchIrcChannel channel, TwitchChannelUser from, string message)
 {
     //Treat the same as messages.
     OnMessage(channel, from, message);
 }
Exemple #8
0
 protected override void OnClear(TwitchIrcChannel channel, TwitchChannelUser from = null)
 {
     //
 }