예제 #1
0
        public void ParseMessage(SocketMessage arg)
        {
            ulong  targetChannelId = arg.Channel.Id;
            string sourceUsername  = arg.Author.Username;

            //Determine if there is an EchoTask by the username
            if (TaskHandler.ContainsTask(sourceUsername) && TaskHandler.Lookup(sourceUsername).Status == BotTaskStatus.Active)
            {
                if (TaskHandler.Allowed(sourceUsername))
                {
                    SendMessage(targetChannelId, (TaskHandler.Lookup(sourceUsername) as EchoTask).Response);
                }
            }

            if (arg.Content == "_k")
            {
                SendMessage(targetChannelId, KELVIN_EMOJI_STRING);
            }
        }