Exemplo n.º 1
0
 public Alias(Command command, string alias)
     : base(true)
 {
     TriggerOnChannel = command.TriggerOnChannel;
     TriggerOnPrivate = command.TriggerOnPrivate;
     RequiresPrefix = command.RequiresPrefix;
     ForbidsPrefix = command.ForbidsPrefix;
     QRequired = command.QRequired;
     Privilege = command.Privilege;
     this.alias = alias;
     this.actual = command;
     CommandHandler.AddCommand(this);
 }
Exemplo n.º 2
0
 public void AddSubCommand(Command sub)
 {
     if (subcommands.Contains(sub)) throw new Exception("Duplicate sub command");
     subcommands.Add(sub);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Adds a command to the command handler
 /// </summary>
 /// <param name="command">The command to add to the command handler</param>
 public static void AddCommand(Command command)
 {
     string keyword = command.GetKeyword().ToLower();
     if (commands.ContainsKey(keyword)) throw new Exception("Command with keyword '" + keyword + "' already exists");
     commands.Add(keyword, command);
     if (OnChanged != null) OnChanged.Invoke();
 }
Exemplo n.º 4
0
 /// <summary>
 /// Adds an alias to the command handler
 /// </summary>
 /// <param name="command">The command to alias to</param>
 /// <param name="alias">The aliassed keyword</param>
 /// <returns>The new alias</returns>
 public static Alias AddAlias(Command command, string alias)
 {
     return new Alias(command, alias);
 }