diff options
author | 2022-08-19 13:50:42 +0100 | |
---|---|---|
committer | 2022-08-19 13:50:42 +0100 | |
commit | 36eb3d19c742dac3351ff90e44509115867a512b (patch) | |
tree | 1b53a1d47e5a18a2cc03ff8a2c0a89491e7d85b2 | |
parent | Update bookmark error handling (diff) |
Require dm delete command be invoceed by replying to a lance message
-rw-r--r-- | bot/exts/utilities/bookmark.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/bot/exts/utilities/bookmark.py b/bot/exts/utilities/bookmark.py index 70175c80..2e3458d8 100644 --- a/bot/exts/utilities/bookmark.py +++ b/bot/exts/utilities/bookmark.py @@ -155,19 +155,16 @@ class Bookmark(commands.Cog): async def delete_bookmark( self, ctx: commands.Context, - target_message: Optional[WrappedMessageConverter] ) -> None: """ - Delete the target message specified by the member. Must be ran in DMs targetting a message sent by Sir-Lancebot. + Delete the Sir-Lancebot message that the command invocation is replying to. - `target_message` may be a message link, or an ID that references the message, - Instead of giving a `target_message` the user may also reply to the message to delete. - - This command allows deleting any message sent by Sir-Lancebot in the user's DMs. + This command allows deleting any message sent by Sir-Lancebot in the user's DM channel with the bot. + The command invocation must be a reply to the message that is to be deleted. """ - target_message: Optional[discord.Message] = target_message or getattr(ctx.message.reference, "resolved", None) + target_message: Optional[discord.Message] = getattr(ctx.message.reference, "resolved", None) if target_message is None: - raise commands.UserInputError(MESSAGE_NOT_FOUND_ERROR) + raise commands.UserInputError("You must reply to the message from Sir-Lancebot you wish to delete.") if not isinstance(ctx.channel, discord.DMChannel): raise commands.UserInputError("You can only run this command your own DMs!") |