aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-07-28 23:53:24 -0400
committerRapptz <[email protected]>2021-07-28 23:53:24 -0400
commit731a8816bbe2e1bfc73ee473dde60fa31bee8a8c (patch)
tree4f29045d683f392cea74ee385f83c234a58ecc05
parentAllow creating a public thread without a starter message (diff)
downloaddiscord.py-731a8816bbe2e1bfc73ee473dde60fa31bee8a8c.tar.xz
discord.py-731a8816bbe2e1bfc73ee473dde60fa31bee8a8c.zip
[commands] Check for ctx.guild instead of abc.GuildChannel
-rw-r--r--discord/ext/commands/core.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py
index 78fc9560..ef520e65 100644
--- a/discord/ext/commands/core.py
+++ b/discord/ext/commands/core.py
@@ -1603,7 +1603,7 @@ def has_role(item):
"""
def predicate(ctx):
- if not isinstance(ctx.channel, discord.abc.GuildChannel):
+ if ctx.guild is None:
raise NoPrivateMessage()
if isinstance(item, int):
@@ -1648,7 +1648,7 @@ def has_any_role(*items):
await ctx.send('You are cool indeed')
"""
def predicate(ctx):
- if not isinstance(ctx.channel, discord.abc.GuildChannel):
+ if ctx.guild is None:
raise NoPrivateMessage()
getter = functools.partial(discord.utils.get, ctx.author.roles)