.langset and .langsetd no longer need perms to run without args (to check current language)

This commit is contained in:
Kwoth 2017-02-13 18:08:14 +01:00
parent 8ed7a4c5d8
commit b3a4fec141

View File

@ -25,16 +25,17 @@ namespace NadekoBot.Modules.Administration
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)] [RequireContext(ContextType.Guild)]
[RequireUserPermission(GuildPermission.Administrator)] public async Task LanguageSet()
public async Task LanguageSet([Remainder] string name = null)
{ {
if (string.IsNullOrWhiteSpace(name)) 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);
var cul = NadekoBot.Localization.GetCultureInfo(Context.Guild); }
await Context.Channel.SendConfirmAsync("This server's language is set to " + cul + " - " + cul.NativeName).ConfigureAwait(false);
return;
}
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
[RequireUserPermission(GuildPermission.Administrator)]
public async Task LanguageSet(string name)
{
CultureInfo ci = null; CultureInfo ci = null;
try try
{ {
@ -59,15 +60,17 @@ namespace NadekoBot.Modules.Administration
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
[OwnerOnly] public async Task LanguageSetDefault()
public async Task LanguageSetDefault([Remainder]string name = null) {
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; CultureInfo ci = null;
try try
{ {