public void EnableGuildCommandOrModule(GuildAccount guild, string input) { var result = _commands.AdvancedSearch(input); if (result.Module is null) { guild.EnableCommand(_commands.FormatCommandName(result.Command)); } else { EnableEntireModuleInGuild(guild, result.Module); } }
private void EnableEntireModuleInGuild(GuildAccount guild, ModuleInfo module) { for (int i = 0; i < module.Commands.Count; i++) { var cmd = module.Commands[i]; guild.EnableCommand(_commands.FormatCommandName(cmd)); } for (int i = 0; i < module.Submodules.Count; i++) { EnableEntireModuleInGuild(guild, module.Submodules[i]); } }