aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/evergreen/fun.py
diff options
context:
space:
mode:
authorGravatar Xithrius <[email protected]>2021-09-02 12:33:56 -0700
committerGravatar GitHub <[email protected]>2021-09-02 12:33:56 -0700
commit02e620db2a8a04d18d0b720abeaf8c07e0ab1a26 (patch)
tree83b0fd28a0203a948b5d3eb64270d1799ac7c4b0 /bot/exts/evergreen/fun.py
parentMore explicit importing for `Bot` (diff)
parentMerge pull request #838 from python-discord/Use-permissions_for-over-permissi... (diff)
Merge branch 'main' into decorator-factory/typehints-fix
Diffstat (limited to 'bot/exts/evergreen/fun.py')
-rw-r--r--bot/exts/evergreen/fun.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/bot/exts/evergreen/fun.py b/bot/exts/evergreen/fun.py
index 40743e7b..4bbfe859 100644
--- a/bot/exts/evergreen/fun.py
+++ b/bot/exts/evergreen/fun.py
@@ -198,11 +198,13 @@ class Fun(Cog):
msg = await Fun._get_discord_message(ctx, text)
# Ensure the user has read permissions for the channel the message is in
- if isinstance(msg, Message) and ctx.author.permissions_in(msg.channel).read_messages:
- text = msg.clean_content
- # Take first embed because we can't send multiple embeds
- if msg.embeds:
- embed = msg.embeds[0]
+ if isinstance(msg, Message):
+ permissions = msg.channel.permissions_for(ctx.author)
+ if permissions.read_messages:
+ text = msg.clean_content
+ # Take first embed because we can't send multiple embeds
+ if msg.embeds:
+ embed = msg.embeds[0]
return (text, embed)