aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/utilities
diff options
context:
space:
mode:
authorGravatar Amrou Bellalouna <[email protected]>2022-12-23 17:18:26 +0100
committerGravatar shtlrs <[email protected]>2023-02-19 14:42:20 +0100
commit7c711ece4168bddb6e491bc268ac3603ab6c7c07 (patch)
treec1fdf7d91bf373495fce91db5673e4284f87566d /bot/exts/utilities
parentmove running permission checks in a static method (diff)
delegate building bm embed
Diffstat (limited to 'bot/exts/utilities')
-rw-r--r--bot/exts/utilities/bookmark.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/bot/exts/utilities/bookmark.py b/bot/exts/utilities/bookmark.py
index 6a00ba57..f0aa26de 100644
--- a/bot/exts/utilities/bookmark.py
+++ b/bot/exts/utilities/bookmark.py
@@ -77,6 +77,16 @@ class Bookmark(commands.Cog):
await self.bot.tree.sync()
@staticmethod
+ def build_bookmark_embed(target_message: discord.Message):
+ return discord.Embed(
+ description=(
+ f"Click the button to be sent your very own bookmark to "
+ f"[this message]({target_message.jump_url})."
+ ),
+ colour=Colours.soft_green,
+ )
+
+ @staticmethod
def build_bookmark_dm(target_message: discord.Message, title: str) -> discord.Embed:
"""Build the embed to DM the bookmark requester."""
embed = discord.Embed(
@@ -166,14 +176,8 @@ class Bookmark(commands.Cog):
await self.action_bookmark(ctx.channel, ctx.author, target_message, title)
view = SendBookmark(self.action_bookmark, ctx.author, ctx.channel, target_message, title)
+ embed = self.build_bookmark_embed(target_message)
- embed = discord.Embed(
- description=(
- f"Click the button to be sent your very own bookmark to "
- f"[this message]({target_message.jump_url})."
- ),
- colour=Colours.soft_green,
- )
await ctx.send(embed=embed, view=view)
@bookmark.command(name="delete", aliases=("del", "rm"), root_aliases=("unbm", "unbookmark", "dmdelete", "dmdel"))