From b3a4fec1411395ba15f5de1fe8adc4942fa55b40 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Mon, 13 Feb 2017 18:08:14 +0100 Subject: [PATCH] .langset and .langsetd no longer need perms to run without args (to check current language) --- .../Commands/LocalizationCommands.cs | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/NadekoBot/Modules/Administration/Commands/LocalizationCommands.cs b/src/NadekoBot/Modules/Administration/Commands/LocalizationCommands.cs index daea20a0..684eebf9 100644 --- a/src/NadekoBot/Modules/Administration/Commands/LocalizationCommands.cs +++ b/src/NadekoBot/Modules/Administration/Commands/LocalizationCommands.cs @@ -25,16 +25,17 @@ namespace NadekoBot.Modules.Administration [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] - [RequireUserPermission(GuildPermission.Administrator)] - public async Task LanguageSet([Remainder] string name = null) + public async Task LanguageSet() { - if (string.IsNullOrWhiteSpace(name)) - { - var cul = NadekoBot.Localization.GetCultureInfo(Context.Guild); - await Context.Channel.SendConfirmAsync("This server's language is set to " + cul + " - " + cul.NativeName).ConfigureAwait(false); - return; - } + var cul = NadekoBot.Localization.GetCultureInfo(Context.Guild); + await Context.Channel.SendConfirmAsync("This server's language is set to " + Format.Bold(cul.ToString()) + " - " + Format.Bold(cul.NativeName)).ConfigureAwait(false); + } + [NadekoCommand, Usage, Description, Aliases] + [RequireContext(ContextType.Guild)] + [RequireUserPermission(GuildPermission.Administrator)] + public async Task LanguageSet(string name) + { CultureInfo ci = null; try { @@ -59,15 +60,17 @@ namespace NadekoBot.Modules.Administration } [NadekoCommand, Usage, Description, Aliases] - [OwnerOnly] - public async Task LanguageSetDefault([Remainder]string name = null) + public async Task LanguageSetDefault() + { + var cul = NadekoBot.Localization.DefaultCultureInfo; + await Context.Channel.SendConfirmAsync("Bot's language is set to " + cul + " - " + cul.NativeName).ConfigureAwait(false); + return; + } + + [NadekoCommand, Usage, Description, Aliases] + [OwnerOnly] + public async Task LanguageSetDefault(string name) { - if (string.IsNullOrWhiteSpace(name)) - { - var cul = NadekoBot.Localization.GetCultureInfo(Context.Guild); - await Context.Channel.SendConfirmAsync("Bot's language is set to " + cul + " - " + cul.NativeName).ConfigureAwait(false); - return; - } CultureInfo ci = null; try {