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