public async Task WhitelistModule(string modName, [OverrideTypeReader(typeof(GuildSwitchTypeReader))] bool guildwide = false) { var mod = _permService.CService.Modules.SingleOrDefault(m => m.Name.Equals(modName, StringComparison.OrdinalIgnoreCase)); if (mod != null) { if (guildwide) { if (await _permService.WhitelistModuleGuild(Context.Guild, mod).ConfigureAwait(false)) { await ReplyAsync($"Module `{mod.Name}` is now whitelisted in this server.").ConfigureAwait(false); } } else { if (await _permService.WhitelistModule((Context.Channel as ITextChannel) !, mod).ConfigureAwait(false)) { await ReplyAsync($"Module `{mod.Name}` is now whitelisted in this channel.").ConfigureAwait(false); } } } }
public async Task WhitelistModule(string modName, [OverrideTypeReader(typeof(SpecialBoolTypeReader))] bool guildwide = false) { var mod = _permService.CService.Modules.SingleOrDefault(m => m.Name == modName); if (mod != null) { if (guildwide) { if (await _permService.WhitelistModuleGuild(Context.Guild, mod.Name).ConfigureAwait(false)) { await ReplyAsync($"Module `{mod.Name}` is now whitelisted in this server.").ConfigureAwait(false); } } else { if (await _permService.WhitelistModule(Context.Channel as ITextChannel, mod.Name).ConfigureAwait(false)) { await ReplyAsync($"Module `{mod.Name}` is now whitelisted in this channel.").ConfigureAwait(false); } } } }