示例#1
0
 /// <summary>
 /// Appends the specified more responses.
 /// </summary>
 /// <param name="moreResponses">The more responses.</param>
 public void append(CommandResponseHandler moreResponses)
 {
     foreach (object item in moreResponses.getResponses())
     {
         this._responses.Add(item);
     }
 }
示例#2
0
        /// <summary>
        /// Handles the command response handler.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <param name="destination">The destination.</param>
        /// <param name="directedTo">The directed to.</param>
        /// <param name="response">The response.</param>
        private void handleCommandResponseHandler(User source, string destination, string directedTo,
                                                  CommandResponseHandler response)
        {
            if (response != null)
            {
                foreach (CommandResponse item in response.getResponses())
                {
                    string message = item.message;

                    if (directedTo != String.Empty)
                    {
                        message = directedTo + ": " + message;
                    }

                    switch (item.destination)
                    {
                    case CommandResponseDestination.Default:
                        if (overrideBotSilence ||
                            Configuration.singleton()["silence", destination] != "true")
                        {
                            Helpmebot6.irc.ircPrivmsg(destination, message);
                        }
                        break;

                    case CommandResponseDestination.ChannelDebug:
                        Helpmebot6.irc.ircPrivmsg(Helpmebot6.debugChannel, message);
                        break;

                    case CommandResponseDestination.PrivateMessage:
                        Helpmebot6.irc.ircPrivmsg(source.nickname, message);
                        break;
                    }
                }
            }
        }