.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]
[RequireContext(ContextType.Guild)]
[RequireUserPermission(GuildPermission.Administrator)]
public async Task LanguageSet([Remainder] string name = null)
{
if (string.IsNullOrWhiteSpace(name))
public async Task LanguageSet()
{
var cul = NadekoBot.Localization.GetCultureInfo(Context.Guild);
await Context.Channel.SendConfirmAsync("This server's language is set to " + cul + " - " + cul.NativeName).ConfigureAwait(false);
return;
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()
{
if (string.IsNullOrWhiteSpace(name))
{
var cul = NadekoBot.Localization.GetCultureInfo(Context.Guild);
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)
{
CultureInfo ci = null;
try
{