aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bot/exts/utils/attachment_pastebin_uploader.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/bot/exts/utils/attachment_pastebin_uploader.py b/bot/exts/utils/attachment_pastebin_uploader.py
index d39c03f10..b4db2ee07 100644
--- a/bot/exts/utils/attachment_pastebin_uploader.py
+++ b/bot/exts/utils/attachment_pastebin_uploader.py
@@ -128,10 +128,13 @@ class AutoTextAttachmentUploader(commands.Cog):
# Send the user a DM with the delete link for the paste.
# The angle brackets around the remove link are required to stop Discord from visiting the URL to produce a
# preview, thereby deleting the paste
- await message.author.send(
- f"[Click here](<{paste_response.removal}>) to delete the pasted attachment"
- f" contents copied from [your message](<{message.jump_url}>)"
- )
+ try:
+ await message.author.send(
+ f"[Click here](<{paste_response.removal}>) to delete the pasted attachment"
+ f" contents copied from [your message](<{message.jump_url}>)"
+ )
+ except discord.Forbidden:
+ log.debug(f"User {message.author} has DMs disabled, skipping delete link DM.")
# Edit the bot message to contain the link to the paste.
await bot_reply.edit(content=f"[Click here]({paste_response.link}) to see this code in our pastebin.")