mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 11:48:55 -05:00
Fix AttributeError in new decorators added to requires (#5665)
This commit is contained in:
parent
35f1681dc1
commit
2995a457f6
@ -760,8 +760,8 @@ def bot_can_manage_channel(*, allow_thread_owner: bool = False) -> Callable[[_T]
|
|||||||
if ctx.guild is None:
|
if ctx.guild is None:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if not utils.can_manage_channel_in(
|
if not utils.can_user_manage_channel(
|
||||||
ctx.channel, ctx.me, allow_thread_owner=allow_thread_owner
|
ctx.me, ctx.channel, allow_thread_owner=allow_thread_owner
|
||||||
):
|
):
|
||||||
if isinstance(ctx.channel, discord.Thread):
|
if isinstance(ctx.channel, discord.Thread):
|
||||||
# This is a slight lie - thread owner *might* also be allowed
|
# 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
|
privilege_level: Optional[PrivilegeLevel] = None, allow_thread_owner: bool = False
|
||||||
) -> Callable[[_T], _T]:
|
) -> Callable[[_T], _T]:
|
||||||
async def predicate(ctx: "Context") -> bool:
|
async def predicate(ctx: "Context") -> bool:
|
||||||
if utils.can_manage_channel_in(
|
if utils.can_user_manage_channel(
|
||||||
ctx.channel, ctx.author, allow_thread_owner=allow_thread_owner
|
ctx.author, ctx.channel, allow_thread_owner=allow_thread_owner
|
||||||
):
|
):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user