Fix AttributeError in new decorators added to requires (#5665)

This commit is contained in:
TrustyJAID 2022-04-02 20:27:24 -06:00 committed by GitHub
parent 35f1681dc1
commit 2995a457f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -760,8 +760,8 @@ def bot_can_manage_channel(*, allow_thread_owner: bool = False) -> Callable[[_T]
if ctx.guild is None:
return False
if not utils.can_manage_channel_in(
ctx.channel, ctx.me, allow_thread_owner=allow_thread_owner
if not utils.can_user_manage_channel(
ctx.me, ctx.channel, allow_thread_owner=allow_thread_owner
):
if isinstance(ctx.channel, discord.Thread):
# This is a slight lie - thread owner *might* also be allowed
@ -798,8 +798,8 @@ def _can_manage_channel_deco(
privilege_level: Optional[PrivilegeLevel] = None, allow_thread_owner: bool = False
) -> Callable[[_T], _T]:
async def predicate(ctx: "Context") -> bool:
if utils.can_manage_channel_in(
ctx.channel, ctx.author, allow_thread_owner=allow_thread_owner
if utils.can_user_manage_channel(
ctx.author, ctx.channel, allow_thread_owner=allow_thread_owner
):
return True