localized mute commands

This commit is contained in:
Kwoth
2017-02-14 16:36:02 +01:00
parent f9c9896926
commit 8c27082c14
3 changed files with 110 additions and 14 deletions

View File

@@ -156,7 +156,7 @@ namespace NadekoBot.Modules.Administration
guildMuteRoles.AddOrUpdate(Context.Guild.Id, name, (id, old) => name);
await uow.CompleteAsync().ConfigureAwait(false);
}
await Context.Channel.SendConfirmAsync("☑️ **New mute role set.**").ConfigureAwait(false);
await ReplyConfirmLocalized("mute_role_set").ConfigureAwait(false);
}
[NadekoCommand, Usage, Description, Aliases]
@@ -174,12 +174,12 @@ namespace NadekoBot.Modules.Administration
{
try
{
await MuteUser(user).ConfigureAwait(false);
await Context.Channel.SendConfirmAsync($"🔇 **{user}** has been **muted** from text and voice chat.").ConfigureAwait(false);
await MuteUser(user).ConfigureAwait(false);
await ReplyConfirmLocalized("user_muted", Format.Bold(user.ToString())).ConfigureAwait(false);
}
catch
{
await Context.Channel.SendErrorAsync("⚠️ I most likely don't have the permission necessary for that.").ConfigureAwait(false);
await ReplyErrorLocalized("mute_error").ConfigureAwait(false);
}
}
@@ -192,11 +192,11 @@ namespace NadekoBot.Modules.Administration
try
{
await UnmuteUser(user).ConfigureAwait(false);
await Context.Channel.SendConfirmAsync($"🔉 **{user}** has been **unmuted** from text and voice chat.").ConfigureAwait(false);
await ReplyConfirmLocalized("user_unmuted", Format.Bold(user.ToString())).ConfigureAwait(false);
}
catch
{
await Context.Channel.SendErrorAsync("⚠️ I most likely don't have the permission necessary for that.").ConfigureAwait(false);
await ReplyErrorLocalized("mute_error").ConfigureAwait(false);
}
}
@@ -209,11 +209,11 @@ namespace NadekoBot.Modules.Administration
{
await user.AddRolesAsync(await GetMuteRole(Context.Guild).ConfigureAwait(false)).ConfigureAwait(false);
UserMuted(user, MuteType.Chat);
await Context.Channel.SendConfirmAsync($"✏️🚫 **{user}** has been **muted** from chatting.").ConfigureAwait(false);
await ReplyConfirmLocalized("user_chat_mute", Format.Bold(user.ToString())).ConfigureAwait(false);
}
catch
{
await Context.Channel.SendErrorAsync("⚠️ I most likely don't have the permission necessary for that.").ConfigureAwait(false);
await ReplyErrorLocalized("mute_error").ConfigureAwait(false);
}
}
@@ -226,11 +226,11 @@ namespace NadekoBot.Modules.Administration
{
await user.RemoveRolesAsync(await GetMuteRole(Context.Guild).ConfigureAwait(false)).ConfigureAwait(false);
UserUnmuted(user, MuteType.Chat);
await Context.Channel.SendConfirmAsync($"✏️✅ **{user}** has been **unmuted** from chatting.").ConfigureAwait(false);
await ReplyConfirmLocalized("user_chat_unmute", Format.Bold(user.ToString())).ConfigureAwait(false);
}
catch
{
await Context.Channel.SendErrorAsync("⚠️ I most likely don't have the permission necessary for that.").ConfigureAwait(false);
await ReplyErrorLocalized("mute_error").ConfigureAwait(false);
}
}
@@ -243,11 +243,11 @@ namespace NadekoBot.Modules.Administration
{
await user.ModifyAsync(usr => usr.Mute = true).ConfigureAwait(false);
UserMuted(user, MuteType.Voice);
await Context.Channel.SendConfirmAsync($"🎙🚫 **{user}** has been **voice muted**.").ConfigureAwait(false);
await ReplyConfirmLocalized("user_voice_mute", Format.Bold(user.ToString())).ConfigureAwait(false);
}
catch
{
await Context.Channel.SendErrorAsync("⚠️ I most likely don't have the permission necessary for that.").ConfigureAwait(false);
await ReplyErrorLocalized("mute_error").ConfigureAwait(false);
}
}
@@ -260,11 +260,11 @@ namespace NadekoBot.Modules.Administration
{
await user.ModifyAsync(usr => usr.Mute = false).ConfigureAwait(false);
UserUnmuted(user, MuteType.Voice);
await Context.Channel.SendConfirmAsync($"🎙✅ **{user}** has been **voice unmuted**.").ConfigureAwait(false);
await ReplyConfirmLocalized("user_voice_unmute", Format.Bold(user.ToString())).ConfigureAwait(false);
}
catch
{
await Context.Channel.SendErrorAsync("⚠️ I most likely don't have the permission necessary for that.").ConfigureAwait(false);
await ReplyErrorLocalized("mute_error").ConfigureAwait(false);
}
}
}