New commandstrings, .unmute, .textunmute
This commit is contained in:
parent
f4db6569de
commit
763c1b4951
@ -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)]
|
||||
|
58
src/NadekoBot/Resources/CommandStrings.Designer.cs
generated
58
src/NadekoBot/Resources/CommandStrings.Designer.cs
generated
@ -3876,7 +3876,7 @@ namespace NadekoBot.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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..
|
||||
/// </summary>
|
||||
public static string moveperm_desc {
|
||||
get {
|
||||
@ -4713,7 +4713,7 @@ namespace NadekoBot.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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..
|
||||
/// </summary>
|
||||
public static string removeperm_desc {
|
||||
get {
|
||||
@ -6296,6 +6296,33 @@ namespace NadekoBot.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to textunmute.
|
||||
/// </summary>
|
||||
public static string textunmute_cmd {
|
||||
get {
|
||||
return ResourceManager.GetString("textunmute_cmd", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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..
|
||||
/// </summary>
|
||||
public static string textunmute_desc {
|
||||
get {
|
||||
return ResourceManager.GetString("textunmute_desc", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to `{0}textunmute @Someone`.
|
||||
/// </summary>
|
||||
public static string textunmute_usage {
|
||||
get {
|
||||
return ResourceManager.GetString("textunmute_usage", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to tl.
|
||||
/// </summary>
|
||||
@ -6593,6 +6620,33 @@ namespace NadekoBot.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to unmute.
|
||||
/// </summary>
|
||||
public static string unmute_cmd {
|
||||
get {
|
||||
return ResourceManager.GetString("unmute_cmd", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Unmutes a mentioned user previously muted with `{0}mute` command..
|
||||
/// </summary>
|
||||
public static string unmute_desc {
|
||||
get {
|
||||
return ResourceManager.GetString("unmute_desc", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to `{0}unmute @Someone`.
|
||||
/// </summary>
|
||||
public static string unmute_usage {
|
||||
get {
|
||||
return ResourceManager.GetString("unmute_usage", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to unstuck.
|
||||
/// </summary>
|
||||
|
@ -2484,4 +2484,22 @@
|
||||
<data name="setstream_usage" xml:space="preserve">
|
||||
<value>`{0}setstream https://www.twitch.tv/masterkwoth Developing Nakedo`</value>
|
||||
</data>
|
||||
</root>
|
||||
<data name="textunmute_cmd" xml:space="preserve">
|
||||
<value>textunmute</value>
|
||||
</data>
|
||||
<data name="textunmute_desc" xml:space="preserve">
|
||||
<value>Removes a mute role previously set on a mentioned user with `{0}textmute` which prevented him from chatting in text channels.</value>
|
||||
</data>
|
||||
<data name="textunmute_usage" xml:space="preserve">
|
||||
<value>`{0}textunmute @Someone`</value>
|
||||
</data>
|
||||
<data name="unmute_cmd" xml:space="preserve">
|
||||
<value>unmute</value>
|
||||
</data>
|
||||
<data name="unmute_desc" xml:space="preserve">
|
||||
<value>Unmutes a mentioned user previously muted with `{0}mute` command.</value>
|
||||
</data>
|
||||
<data name="unmute_usage" xml:space="preserve">
|
||||
<value>`{0}unmute @Someone`</value>
|
||||
</data>
|
||||
</root>
|
Loading…
Reference in New Issue
Block a user