/// <summary> /// Adds the specified message to the response. /// </summary> /// <param name="message">The message.</param> /// <param name="destination">The destination.</param> public void respond(string message, CommandResponseDestination destination) { CommandResponse cr; cr.destination = destination; cr.message = message; this._responses.Add(cr); }
public IEnumerable <CommandResponse> Respond( string messageKey, string context, object[] arguments, Context contextType = null, CommandResponseDestination destination = CommandResponseDestination.Default, CommandResponseType type = CommandResponseType.Message, bool ignoreRedirection = false, IEnumerable <string> redirectionTarget = null) { List <string> redirectionTargetList = null; if (redirectionTarget != null) { redirectionTargetList = redirectionTarget.ToList(); } return(this.GetMessagePartAlternates(messageKey, context, arguments, contextType, false).Select( parsedString => { string ctcp = null; var msgIgnoreRedir = ignoreRedirection; var msgDest = destination; var msg = parsedString; if (msg.StartsWith("#ACTION")) { ctcp = "ACTION"; msgIgnoreRedir = true; msg = msg.Substring("#ACTION ".Length); } if (msg.StartsWith("#PRIVMSG")) { msgDest = CommandResponseDestination.PrivateMessage; msg = msg.Substring("#PRIVMSG ".Length); msgIgnoreRedir = true; } return new CommandResponse { Message = msg, ClientToClientProtocol = ctcp, IgnoreRedirection = msgIgnoreRedir, Destination = msgDest, Type = type, RedirectionTarget = redirectionTargetList }; })); }
/// <summary> /// Adds the specified message to the response. /// </summary> /// <param name="message"> /// The message. /// </param> /// <param name="destination"> /// The destination. /// </param> public void Respond(string message, CommandResponseDestination destination) { CommandResponse cr; cr.Destination = destination; cr.Message = message; this.responses.Add(cr); }
/// <summary> /// Initialises a new instance of the <see cref="CommandResponseHandler"/> class. /// </summary> /// <param name="message"> /// A message. /// </param> /// <param name="destination"> /// The destination of the message. /// </param> public CommandResponseHandler(string message, CommandResponseDestination destination) { this.responses = new ArrayList(); this.Respond(message, destination); }
/// <summary> /// Initializes a new instance of the <see cref="CommandResponseHandler"/> class. /// </summary> /// <param name="message">A message.</param> /// <param name="destination">The destination of the message.</param> public CommandResponseHandler(string message, CommandResponseDestination destination) { this._responses = new ArrayList(); respond(message, destination); }