From 0cbb0aa7da979cb711073da113482a20dcd5b927 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 2 Nov 2025 00:27:05 +0000 Subject: [PATCH 1/3] Initial plan From dfe00e6a600d366baee2424c28bf1a7ef2e68535 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 2 Nov 2025 00:31:33 +0000 Subject: [PATCH 2/3] Fix paste uploader to handle closed DMs Co-authored-by: jb3 <20439493+jb3@users.noreply.github.com> --- bot/exts/utils/attachment_pastebin_uploader.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bot/exts/utils/attachment_pastebin_uploader.py b/bot/exts/utils/attachment_pastebin_uploader.py index 1ea74b5090..916d60096d 100644 --- a/bot/exts/utils/attachment_pastebin_uploader.py +++ b/bot/exts/utils/attachment_pastebin_uploader.py @@ -3,6 +3,7 @@ import re import discord +from discord import Forbidden from discord.ext import commands from pydis_core.utils import paste_service @@ -128,7 +129,10 @@ 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(content=f"[Click here](<{paste_response.removal}>) to delete your recent paste.") + try: + await message.author.send(content=f"[Click here](<{paste_response.removal}>) to delete your recent paste.") + except 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.") From 76d1d7b39f9ceb968e6d8d8141c9d87eaf45e92c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 2 Nov 2025 00:39:27 +0000 Subject: [PATCH 3/3] Use discord.Forbidden instead of importing Forbidden Co-authored-by: jb3 <20439493+jb3@users.noreply.github.com> --- bot/exts/utils/attachment_pastebin_uploader.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bot/exts/utils/attachment_pastebin_uploader.py b/bot/exts/utils/attachment_pastebin_uploader.py index 916d60096d..eb114faa05 100644 --- a/bot/exts/utils/attachment_pastebin_uploader.py +++ b/bot/exts/utils/attachment_pastebin_uploader.py @@ -3,7 +3,6 @@ import re import discord -from discord import Forbidden from discord.ext import commands from pydis_core.utils import paste_service @@ -131,7 +130,7 @@ async def on_message(self, message: discord.Message) -> None: # preview, thereby deleting the paste try: await message.author.send(content=f"[Click here](<{paste_response.removal}>) to delete your recent paste.") - except Forbidden: + 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.