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