diff options
| -rw-r--r-- | bot/exts/info/code_snippets.py | 4 | ||||
| -rw-r--r-- | bot/exts/utils/attachment_pastebin_uploader.py | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/bot/exts/info/code_snippets.py b/bot/exts/info/code_snippets.py index 1ba4151c7..f127d1650 100644 --- a/bot/exts/info/code_snippets.py +++ b/bot/exts/info/code_snippets.py @@ -10,7 +10,7 @@ from aiohttp import ClientResponseError from discord.ext.commands import Cog from bot.bot import Bot -from bot.constants import Channels +from bot.constants import Channels, Keys from bot.log import get_logger from bot.utils.messages import wait_for_deletion @@ -28,6 +28,8 @@ GITHUB_GIST_RE = re.compile( ) GITHUB_HEADERS = {"Accept": "application/vnd.github.v3.raw"} +if Keys.github: + GITHUB_HEADERS["Authorization"] = f"token {Keys.github}" GITLAB_RE = re.compile( r"https://gitlab\.com/(?P<repo>[\w.-]+/[\w.-]+)/\-/blob/(?P<path>[^#>]+)" diff --git a/bot/exts/utils/attachment_pastebin_uploader.py b/bot/exts/utils/attachment_pastebin_uploader.py index eb114faa0..b4db2ee07 100644 --- a/bot/exts/utils/attachment_pastebin_uploader.py +++ b/bot/exts/utils/attachment_pastebin_uploader.py @@ -129,7 +129,10 @@ class AutoTextAttachmentUploader(commands.Cog): # The angle brackets around the remove link are required to stop Discord from visiting the URL to produce a # preview, thereby deleting the paste try: - await message.author.send(content=f"[Click here](<{paste_response.removal}>) to delete your recent 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}>)" + ) except discord.Forbidden: log.debug(f"User {message.author} has DMs disabled, skipping delete link DM.") |