From 0b0b23b9717b40ed4f8715720b199417c8e89750 Mon Sep 17 00:00:00 2001 From: Michael Oliveira <34169552+Flame442@users.noreply.github.com> Date: Wed, 10 Jul 2024 14:41:24 -0400 Subject: [PATCH] Fix `@commands.can_manage_channel` always passing (#6398) --- redbot/core/commands/requires.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/redbot/core/commands/requires.py b/redbot/core/commands/requires.py index b5526a6712c..9a94bd03d02 100644 --- a/redbot/core/commands/requires.py +++ b/redbot/core/commands/requires.py @@ -761,7 +761,7 @@ def decorator(func: _T) -> _T: def _can_manage_channel_deco( - privilege_level: Optional[PrivilegeLevel] = None, allow_thread_owner: bool = False + *, privilege_level: Optional[PrivilegeLevel] = None, allow_thread_owner: bool = False ) -> Callable[[_T], _T]: async def predicate(ctx: "Context") -> bool: if utils.can_user_manage_channel( @@ -803,7 +803,7 @@ def can_manage_channel(*, allow_thread_owner: bool = False) -> Callable[[_T], _T as that, in addition to members with manage channel/threads permission, can also be done by the thread owner. """ - return _can_manage_channel_deco(allow_thread_owner) + return _can_manage_channel_deco(allow_thread_owner=allow_thread_owner) def is_owner(): @@ -837,7 +837,9 @@ def guildowner_or_can_manage_channel(*, allow_thread_owner: bool = False) -> Cal as that, in addition to members with manage channel/threads permission, can also be done by the thread owner. """ - return _can_manage_channel_deco(PrivilegeLevel.GUILD_OWNER, allow_thread_owner) + return _can_manage_channel_deco( + privilege_level=PrivilegeLevel.GUILD_OWNER, allow_thread_owner=allow_thread_owner + ) def guildowner(): @@ -871,7 +873,9 @@ def admin_or_can_manage_channel(*, allow_thread_owner: bool = False) -> Callable as that, in addition to members with manage channel/threads permission, can also be done by the thread owner. """ - return _can_manage_channel_deco(PrivilegeLevel.ADMIN, allow_thread_owner) + return _can_manage_channel_deco( + privilege_level=PrivilegeLevel.ADMIN, allow_thread_owner=allow_thread_owner + ) def admin(): @@ -905,7 +909,9 @@ def mod_or_can_manage_channel(*, allow_thread_owner: bool = False) -> Callable[[ as that, in addition to members with manage channel/threads permission, can also be done by the thread owner. """ - return _can_manage_channel_deco(PrivilegeLevel.MOD, allow_thread_owner) + return _can_manage_channel_deco( + privilege_level=PrivilegeLevel.MOD, allow_thread_owner=allow_thread_owner + ) def mod():