mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-22 10:47:58 -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
@@ -168,6 +168,17 @@ class PermState(enum.Enum):
|
||||
chain.
|
||||
"""
|
||||
|
||||
# The below are valid states, but should not be transitioned to
|
||||
# They should be set if they apply.
|
||||
|
||||
ALLOWED_BY_HOOK = enum.auto()
|
||||
"""This command has been actively allowed by a permission hook.
|
||||
check validation doesn't need this, but is useful to developers"""
|
||||
|
||||
DENIED_BY_HOOK = enum.auto()
|
||||
"""This command has been actively denied by a permission hook
|
||||
check validation doesn't need this, but is useful to developers"""
|
||||
|
||||
def transition_to(
|
||||
self, next_state: "PermState"
|
||||
) -> Tuple[Optional[bool], Union["PermState", Dict[bool, "PermState"]]]:
|
||||
|
||||
Reference in New Issue
Block a user