diff --git a/bot/exts/utils/attachment_pastebin_uploader.py b/bot/exts/utils/attachment_pastebin_uploader.py index d39c03f10a..b4db2ee07c 100644 --- a/bot/exts/utils/attachment_pastebin_uploader.py +++ b/bot/exts/utils/attachment_pastebin_uploader.py @@ -128,10 +128,13 @@ async def on_message(self, message: discord.Message) -> None: # 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.")