aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/utilities/bookmark.py
diff options
context:
space:
mode:
authorGravatar Amrou Bellalouna <[email protected]>2022-12-28 09:07:31 +0100
committerGravatar shtlrs <[email protected]>2023-02-19 14:42:20 +0100
commit09476fdce4a894162bd84d3d7dbd6a5f2b82bb28 (patch)
tree1d5309e5dd4012bc03b767d31e418e608245907a /bot/exts/utilities/bookmark.py
parentreturn embed directly from build_bookmark_embed (diff)
move class var before ctor
Diffstat (limited to 'bot/exts/utilities/bookmark.py')
-rw-r--r--bot/exts/utilities/bookmark.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/bot/exts/utilities/bookmark.py b/bot/exts/utilities/bookmark.py
index 75317708..c67d1baf 100644
--- a/bot/exts/utilities/bookmark.py
+++ b/bot/exts/utilities/bookmark.py
@@ -30,15 +30,6 @@ class BookmarkTitleSelectionForm(discord.ui.Modal):
This form is only available when the command is invoked from a context menu.
"""
- def __init__(
- self,
- message: discord.Message,
- action_bookmark_function: Callable[[discord.TextChannel, discord.Member, discord.Message, str], None],
- ):
- super().__init__(timeout=1000, title="Name your bookmark")
- self.message = message
- self.action_bookmark = action_bookmark_function
-
bookmark_title = discord.ui.TextInput(
label="Choose a title for you bookmark",
placeholder="Type your bookmark title here",
@@ -48,6 +39,15 @@ class BookmarkTitleSelectionForm(discord.ui.Modal):
required=False
)
+ def __init__(
+ self,
+ message: discord.Message,
+ action_bookmark_function: Callable[[discord.TextChannel, discord.Member, discord.Message, str], None],
+ ):
+ super().__init__(timeout=1000, title="Name your bookmark")
+ self.message = message
+ self.action_bookmark = action_bookmark_function
+
async def on_submit(self, interaction: discord.Interaction) -> None:
"""Sends the bookmark embed to the user with the newly chosen title."""
title = self.bookmark_title.value or self.bookmark_title.default