diff options
| author | 2021-09-03 00:31:12 -0700 | |
|---|---|---|
| committer | 2021-09-03 00:31:12 -0700 | |
| commit | ea47bc617e558929bcee39e6008a57d6dd814aa1 (patch) | |
| tree | c40e2f23e55119fb33f83271d227103cb9be7c6f /bot/exts/evergreen/bookmark.py | |
| parent | Improved consistency for codeblocks to end with a newline (diff) | |
| parent | Merge pull request #802 from python-discord/decorator-factory/typehints-fix (diff) | |
Merge branch 'main' into android-codeblock-fix
Diffstat (limited to 'bot/exts/evergreen/bookmark.py')
| -rw-r--r-- | bot/exts/evergreen/bookmark.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/exts/evergreen/bookmark.py b/bot/exts/evergreen/bookmark.py index 98b0f2bf..a91ef1c0 100644 --- a/bot/exts/evergreen/bookmark.py +++ b/bot/exts/evergreen/bookmark.py @@ -1,7 +1,7 @@ import asyncio import logging import random -import typing as t +from typing import Optional import discord from discord.ext import commands @@ -92,7 +92,7 @@ class Bookmark(commands.Cog): async def bookmark( self, ctx: commands.Context, - target_message: t.Optional[WrappedMessageConverter], + target_message: Optional[WrappedMessageConverter], *, title: str = "Bookmark" ) -> None: @@ -103,7 +103,7 @@ class Bookmark(commands.Cog): target_message = ctx.message.reference.resolved # Prevent users from bookmarking a message in a channel they don't have access to - permissions = ctx.author.permissions_in(target_message.channel) + permissions = target_message.channel.permissions_for(ctx.author) if not permissions.read_messages: log.info(f"{ctx.author} tried to bookmark a message in #{target_message.channel} but has no permissions.") embed = discord.Embed( |