Example #1
0
 public override void ProcessMenssage(IrcMessage message, string[] args)
 {
     if (!IsStarted)
         return;
     if (message.Message.StartsWith(".wiki"))
     {
         string query = message.Message.Substring(6);
         GetWikiData(query);
     }
 }
Example #2
0
        /// <summary>
        /// This method is called when a message is readed
        /// </summary>
        /// <param name="message"></param>
        /// <param name="args"></param>
        public virtual void ProcessMenssage(IrcMessage message, string[] args) 
        {
            
Example #3
0
 public void SendMessage(IrcMessage message)
 {
     SendData(message.ToString());
 }
Example #4
0
 private void SendMessage(IrcMessage message)
 {
     IrcDataEventArgs e = new IrcDataEventArgs(message);
     if (SendingMessage != null)
         SendingMessage(this, e);
     if (!e.Cancel)
     {
         m_client.SendMessage(message);
         if (MesssageSent != null)
             MesssageSent(this, new IrcDataEventArgs(message));
     }
 }
Example #5
0
        private void ProcessMessage(IrcMessage message)
        {
            if (message.From == null || message.Type == MessageType.Other || message.From == "")
                return;
            if (!m_messagesByUser.ContainsKey(message.From))
                m_messagesByUser.Add(message.From, new Queue<IrcMessage>(10));

            m_messagesByUser[message.From].Enqueue(message);
            OnProcessedDataReceived(this, new IrcDataEventArgs(message));

            if (message.Message.ToLower().StartsWith("."))
            {
                foreach (string key in this.AddonsList.Keys)
                {
                    if (message.Message.StartsWith("." + key))
                    {
                        string[] args = message.Message.Split(new char[] {' '}, StringSplitOptions.RemoveEmptyEntries);
                        this.AddonsList[key].ProcessMenssage(message,args);
                        break;
                    }
                }
            }

            else
            {
                switch (message.Type)
                {
                    case MessageType.JOIN:
                        SendChannelMessage("Everybody say Hi to: " + message.From);
                        break;
                    case MessageType.PRIVMSG:
                        break;
                    case MessageType.PING:
                        throw new Exception("Poner el codigo aca");
                        break;
                    default:
                        break;
                }
            }
        }
 public IrcDataEventArgs(IrcMessage message)
 {
     m_message = message;
 }
Example #7
0
 /// <summary>
 /// Handler for receiving PING messages from the server. Responds with a
 /// PONG message.
 /// </summary>
 /// <param name="ircMessage">The message received</param>
 internal virtual async Task PingReceived(IrcMessage ircMessage)
 {
     await SendMessageToServerAsync(new IrcMessage { Command = "PONG" });
 }