mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
Reconcile permission hooks with ctx.permission_state (#2375)
Resolves #2374. See mod.py's voice mute for an example of why this may be necessary.
This commit is contained in:
committed by
Toby Harradine
parent
0d4e6a0865
commit
849ade6e58
@@ -500,7 +500,12 @@ class RedBase(commands.GroupMixin, commands.bot.BotBase, RPCMixin):
|
||||
if result is not None:
|
||||
hook_results.append(result)
|
||||
if hook_results:
|
||||
return all(hook_results)
|
||||
if all(hook_results):
|
||||
ctx.permission_state = commands.PermState.ALLOWED_BY_HOOK
|
||||
return True
|
||||
else:
|
||||
ctx.permission_state = commands.PermState.DENIED_BY_HOOK
|
||||
return False
|
||||
|
||||
|
||||
class Red(RedBase, discord.AutoShardedClient):
|
||||
|
||||
Reference in New Issue
Block a user