aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/utilities
diff options
context:
space:
mode:
authorGravatar Amrou Bellalouna <[email protected]>2023-01-15 13:00:47 +0100
committerGravatar shtlrs <[email protected]>2023-02-19 14:42:20 +0100
commit0dae917e3d02b46296c2087edd2b7ec108ab55f4 (patch)
tree757d6176fa529167ec062f19c1c64d9f7afaa127 /bot/exts/utilities
parentremove the call to action to check DMS for the bm (diff)
disallow usage of the context menu command in DMs
Diffstat (limited to 'bot/exts/utilities')
-rw-r--r--bot/exts/utilities/bookmark.py5
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.")