/// <summary> /// Initializes a new instance of the <see cref="IrcMessageEventArgs"/> class. /// </summary> /// <param name="recipent">The recipent.</param> /// <param name="sender">The sender.</param> /// <param name="message">The message.</param> /// <param name="type">The type.</param> public IrcMessageEventArgs(IIrcRecipent recipent, IrcUser sender, string message, IrcMessageType type) { this.recipent = recipent; this.sender = sender; this.message = message; this.type = type; }
private void ClientCmd_Default(string cmd, IIrcRecipent sentTo, string message) { Send(new IrcCommand(null, cmd, message.Split(' ').Select(s => (IrcParameter)s).ToArray())); }
/// <summary> /// Called when a message is received. /// </summary> /// <param name="recipent">The recipent.</param> /// <param name="sender">The sender.</param> /// <param name="message">The message.</param> /// <param name="type">The message type.</param> protected virtual void OnMessage(IIrcRecipent recipent, IrcUser sender, string message, IrcMessageType type) { if (Message != null) Message(this, new IrcMessageEventArgs(recipent, sender, message, type)); }
private void ClientCmd_Action(string cmd, IIrcRecipent sendTo, string message) { SendMessage(sendTo, ((char)1) + "ACTION " + message + ((char)1)); }
/// <summary> /// Sends a message. /// </summary> /// <param name="sendTo">The receiver.</param> /// <param name="message">The message.</param> public void SendMessage(IIrcRecipent sendTo, string message) { if (message[0] == '/') { string command = message.Substring(1, message.IndexOf(' ') - 1).ToUpper(); string msg = message.Substring(message.IndexOf(' ') + 1); GetClientCommand(command).Invoke(this, new object[] { command, sendTo, msg }); return; } Send(new IrcCommand(null, "PRIVMSG", sendTo.Name, message.AsIrcRestParameter())); }