[Mutes] Handle Forbidden in mute_channel

* Merge pull request #4994
This commit is contained in:
Fixator10 2021-05-19 15:49:37 +04:00 committed by GitHub
parent a58ac7cd2e
commit c40efd479b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1710,6 +1710,12 @@ class Mutes(VoiceMutes, commands.Cog, metaclass=CompositeMetaClass):
"channel": channel, "channel": channel,
"reason": _(MUTE_UNMUTE_ISSUES["left_guild"]), "reason": _(MUTE_UNMUTE_ISSUES["left_guild"]),
} }
except discord.Forbidden:
return {
"success": False,
"channel": channel,
"reason": _(MUTE_UNMUTE_ISSUES["permissions_issue_channel"]),
}
if move_channel: if move_channel:
try: try:
await user.move_to(channel) await user.move_to(channel)