aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/utilities/bookmark.py
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2023-05-06 16:12:32 +0100
committerGravatar Chris Lovering <[email protected]>2023-05-09 15:41:50 +0100
commit613840ebcf303e84048d48ace37fb001c1afe687 (patch)
tree9acaf0bae0527fe8389483a419b44e06997ca060 /bot/exts/utilities/bookmark.py
parentMigrate to ruff (diff)
Apply fixes for ruff linting
Co-authored-by: wookie184 <[email protected]> Co-authored-by: Amrou Bellalouna <[email protected]>
Diffstat (limited to 'bot/exts/utilities/bookmark.py')
-rw-r--r--bot/exts/utilities/bookmark.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/bot/exts/utilities/bookmark.py b/bot/exts/utilities/bookmark.py
index 65a32203..150dfc48 100644
--- a/bot/exts/utilities/bookmark.py
+++ b/bot/exts/utilities/bookmark.py
@@ -1,6 +1,5 @@
import logging
import random
-from typing import Optional
import discord
from discord.ext import commands
@@ -145,15 +144,15 @@ class Bookmark(commands.Cog):
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] = getattr(ctx.message.reference, "resolved", None)
+ target_message: discord.Message | None = getattr(ctx.message.reference, "resolved", None)
if target_message is None:
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!")
- elif target_message.channel != ctx.channel:
+ if target_message.channel != ctx.channel:
raise commands.UserInputError("You can only delete messages in your own DMs!")
- elif target_message.author != self.bot.user:
+ if target_message.author != self.bot.user:
raise commands.UserInputError("You can only delete messages sent by Sir Lancebot!")
await target_message.delete()