Пример #1
0
            public CustomCommandSet()
            {
                command            = "custom";
                shortHelp          = "A collection of saved custom commands.";
                catagory           = Category.Advanced;
                customSet          = this;
                requiredPermission = Permissions.Type.CreateCustomCommands;

                commandsInSet = new Command [] {
                    new New(), new Delete(),
                };
            }
Пример #2
0
        public static List <Command> RecursiveCacheCommands(List <Command> source)
        {
            List <Command> result = new List <Command> ();

            foreach (Command cmd in source)
            {
                if (cmd is CommandSet)
                {
                    CommandSet set = cmd as CommandSet;
                    result.AddRange(RecursiveCacheCommands(set.commandsInSet.ToList()));
                }
                else
                {
                    result.Add(cmd);
                }
            }
            return(result);
        }
Пример #3
0
 public static void DeleteCommand(CustomCommand command, CommandSet set)
 {
     data.customCommands.Remove(command);
     set.RemoveCommand(command);
     SaveData();
 }
Пример #4
0
 public static void AddCommand(CustomCommand newCommand, CommandSet set)
 {
     data.customCommands.Add(newCommand);
     set.AddProceduralCommands(newCommand);
     SaveData();
 }
Пример #5
0
 public Task <Result> Execute(SocketUserMessage e, CommandSet set)
 {
     return(TaskResult(set.GetHelp(e), set.GetHelp(e)));
 }