/// <summary> /// Add a new command to the current context. /// </summary> /// <param name="commandName">String describing which command was use to invoke the method.</param> /// <param name="commandHandle">The parameters to the command, if any.</param> public void AddCommand(string commandName, CommandHandle commandHandle) { if (string.IsNullOrEmpty(commandName)) { throw new ArgumentNullException("AddCommand: parameter commandName null or empty"); } else if (string.IsNullOrWhiteSpace(commandName)) { throw new ArgumentNullException("AddCommand: parameter commandName name consists of whitespace"); } else if (commandHandle == null) { throw new ArgumentNullException("AddCommand: null parameter commandHandle"); } else { Commands.Add(commandName, commandHandle); } }
public BotHandler() { _handler = new CommandHandle(); }