Skip to content

Commit d6b91cf

Browse files
yoggysLulalabyBobDotCom
authored
commands.has_permissions() return True in DM channels (fix #1576) (#1577)
Co-authored-by: Lala Sabathil <[email protected]> Co-authored-by: BobDotCom <[email protected]>
1 parent 3b1a281 commit d6b91cf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

discord/ext/commands/core.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2116,8 +2116,9 @@ async def test(ctx):
21162116
raise TypeError(f"Invalid permission(s): {', '.join(invalid)}")
21172117

21182118
def predicate(ctx: Context) -> bool:
2119-
ch = ctx.channel
2120-
permissions = ch.permissions_for(ctx.author) # type: ignore
2119+
if ctx.channel.type == ChannelType.private:
2120+
return True
2121+
permissions = ctx.channel.permissions_for(ctx.author) # type: ignore
21212122

21222123
missing = [perm for perm, value in perms.items() if getattr(permissions, perm) != value]
21232124

0 commit comments

Comments
 (0)