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(), }; }
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); }
public static void DeleteCommand(CustomCommand command, CommandSet set) { data.customCommands.Remove(command); set.RemoveCommand(command); SaveData(); }
public static void AddCommand(CustomCommand newCommand, CommandSet set) { data.customCommands.Add(newCommand); set.AddProceduralCommands(newCommand); SaveData(); }
public Task <Result> Execute(SocketUserMessage e, CommandSet set) { return(TaskResult(set.GetHelp(e), set.GetHelp(e))); }