diff options
author | 2023-01-15 13:00:47 +0100 | |
---|---|---|
committer | 2023-02-19 14:42:20 +0100 | |
commit | 0dae917e3d02b46296c2087edd2b7ec108ab55f4 (patch) | |
tree | 757d6176fa529167ec062f19c1c64d9f7afaa127 | |
parent | remove the call to action to check DMS for the bm (diff) |
disallow usage of the context menu command in DMs
-rw-r--r-- | bot/exts/utilities/bookmark.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bot/exts/utilities/bookmark.py b/bot/exts/utilities/bookmark.py index 473ecedc..e2988dca 100644 --- a/bot/exts/utilities/bookmark.py +++ b/bot/exts/utilities/bookmark.py @@ -180,6 +180,11 @@ class Bookmark(commands.Cog): async def _bookmark_context_menu_callback(self, interaction: discord.Interaction, message: discord.Message) -> None: """The callback that will be invoked upon using the bookmark's context menu command.""" permissions = interaction.channel.permissions_for(interaction.user) + if not interaction.channel.guild: + embed = Bookmark.build_error_embed("This command cannot be used in DMs.") + await interaction.response.send_message(embed=embed) + return + if not permissions.read_messages: log.info(f"{interaction.user} tried to bookmark a message in #{interaction.channel}" f"but has no permissions.") |