mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
[Mod] [p]mute|unmute voice now take action instantly (#4064)
* make mute and unmute have the same fail string * now add the jucy bits * hmm no This reverts commit a445bd84150585b4ad85c0c1ccadbee2022af196. * Apply suggestions from code review Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com> Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
parent
c4d295b25d
commit
1ee32b77dd
@ -207,6 +207,17 @@ class MuteMixin(MixinMeta):
|
||||
await ctx.send(
|
||||
_("Muted {user} in channel {channel.name}").format(user=user, channel=channel)
|
||||
)
|
||||
try:
|
||||
if channel.permissions_for(ctx.me).move_members:
|
||||
await user.move_to(channel)
|
||||
else:
|
||||
raise RuntimeError
|
||||
except (discord.Forbidden, RuntimeError):
|
||||
await ctx.send(
|
||||
_(
|
||||
"Because I don't have the Move Members permission, this will take into effect when the user rejoins."
|
||||
)
|
||||
)
|
||||
else:
|
||||
await ctx.send(issue)
|
||||
|
||||
@ -322,6 +333,17 @@ class MuteMixin(MixinMeta):
|
||||
await ctx.send(
|
||||
_("Unmuted {user} in channel {channel.name}").format(user=user, channel=channel)
|
||||
)
|
||||
try:
|
||||
if channel.permissions_for(ctx.me).move_members:
|
||||
await user.move_to(channel)
|
||||
else:
|
||||
raise RuntimeError
|
||||
except (discord.Forbidden, RuntimeError):
|
||||
await ctx.send(
|
||||
_(
|
||||
"Because I don't have the Move Members permission, this will take into effect when the user rejoins."
|
||||
)
|
||||
)
|
||||
else:
|
||||
await ctx.send(_("Unmute failed. Reason: {}").format(message))
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user