diff --git a/src/NadekoBot/Modules/Administration/Administration.cs b/src/NadekoBot/Modules/Administration/Administration.cs index a4802a68..d680859c 100644 --- a/src/NadekoBot/Modules/Administration/Administration.cs +++ b/src/NadekoBot/Modules/Administration/Administration.cs @@ -450,6 +450,25 @@ namespace NadekoBot.Modules.Administration } } + [NadekoCommand, Usage, Description, Aliases] + [RequireContext(ContextType.Guild)] + [RequirePermission(GuildPermission.MuteMembers)] + public async Task Unmute(IUserMessage umsg, IGuildUser user) + { + var channel = (ITextChannel)umsg.Channel; + + try + { + await user.ModifyAsync(usr => usr.Mute = false).ConfigureAwait(false); + await user.RemoveRolesAsync(await GetMuteRole(channel.Guild).ConfigureAwait(false)).ConfigureAwait(false); + await channel.SendMessageAsync($"**{user}** was text and voice muted successfully.").ConfigureAwait(false); + } + catch + { + await channel.SendMessageAsync("I most likely don't have the permission necessary for that.").ConfigureAwait(false); + } + } + [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] [RequirePermission(GuildPermission.MuteMembers)] @@ -468,6 +487,24 @@ namespace NadekoBot.Modules.Administration } } + [NadekoCommand, Usage, Description, Aliases] + [RequireContext(ContextType.Guild)] + [RequirePermission(GuildPermission.MuteMembers)] + public async Task TextUnmute(IUserMessage umsg, IGuildUser user) + { + var channel = (ITextChannel)umsg.Channel; + + try + { + await user.RemoveRolesAsync(await GetMuteRole(channel.Guild).ConfigureAwait(false)).ConfigureAwait(false); + await channel.SendMessageAsync($"**{user}** was text muted successfully.").ConfigureAwait(false); + } + catch + { + await channel.SendMessageAsync("I most likely don't have the permission necessary for that.").ConfigureAwait(false); + } + } + [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] [RequirePermission(GuildPermission.MuteMembers)] diff --git a/src/NadekoBot/Resources/CommandStrings.Designer.cs b/src/NadekoBot/Resources/CommandStrings.Designer.cs index d88c31c4..3a186371 100644 --- a/src/NadekoBot/Resources/CommandStrings.Designer.cs +++ b/src/NadekoBot/Resources/CommandStrings.Designer.cs @@ -3876,7 +3876,7 @@ namespace NadekoBot.Resources { } /// - /// Looks up a localized string similar to Moves permission from one position to another.. + /// Looks up a localized string similar to Moves permission from one position to another in Permissions list.. /// public static string moveperm_desc { get { @@ -4713,7 +4713,7 @@ namespace NadekoBot.Resources { } /// - /// Looks up a localized string similar to Removes a permission from a given position. + /// Looks up a localized string similar to Removes a permission from a given position in Permissions list.. /// public static string removeperm_desc { get { @@ -6296,6 +6296,33 @@ namespace NadekoBot.Resources { } } + /// + /// Looks up a localized string similar to textunmute. + /// + public static string textunmute_cmd { + get { + return ResourceManager.GetString("textunmute_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removes a mute role previously set on a mentioned user with `{0}textmute` which prevented him from chatting in text channels.. + /// + public static string textunmute_desc { + get { + return ResourceManager.GetString("textunmute_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}textunmute @Someone`. + /// + public static string textunmute_usage { + get { + return ResourceManager.GetString("textunmute_usage", resourceCulture); + } + } + /// /// Looks up a localized string similar to tl. /// @@ -6593,6 +6620,33 @@ namespace NadekoBot.Resources { } } + /// + /// Looks up a localized string similar to unmute. + /// + public static string unmute_cmd { + get { + return ResourceManager.GetString("unmute_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unmutes a mentioned user previously muted with `{0}mute` command.. + /// + public static string unmute_desc { + get { + return ResourceManager.GetString("unmute_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}unmute @Someone`. + /// + public static string unmute_usage { + get { + return ResourceManager.GetString("unmute_usage", resourceCulture); + } + } + /// /// Looks up a localized string similar to unstuck. /// diff --git a/src/NadekoBot/Resources/CommandStrings.resx b/src/NadekoBot/Resources/CommandStrings.resx index e8016c21..c1980beb 100644 --- a/src/NadekoBot/Resources/CommandStrings.resx +++ b/src/NadekoBot/Resources/CommandStrings.resx @@ -2484,4 +2484,22 @@ `{0}setstream https://www.twitch.tv/masterkwoth Developing Nakedo` - + + textunmute + + + Removes a mute role previously set on a mentioned user with `{0}textmute` which prevented him from chatting in text channels. + + + `{0}textunmute @Someone` + + + unmute + + + Unmutes a mentioned user previously muted with `{0}mute` command. + + + `{0}unmute @Someone` + + \ No newline at end of file