From 3f62d77e8e30308f8760f3118f7da12b97a530eb Mon Sep 17 00:00:00 2001 From: Gokul A R Date: Thu, 20 Aug 2026 10:55:46 +0530 Subject: [PATCH 1/3] Refactor error message handling with send_or_reply --- bot/exts/info/pypi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/exts/info/pypi.py b/bot/exts/info/pypi.py index a00f30753e..e3b72280bb 100644 --- a/bot/exts/info/pypi.py +++ b/bot/exts/info/pypi.py @@ -13,7 +13,7 @@ from bot.constants import Colours, NEGATIVE_REPLIES, RedirectOutput from bot.log import get_logger from bot.utils import time -from bot.utils.messages import wait_for_deletion +from bot.utils.messages import send_or_reply, wait_for_deletion URL = "https://pypi.org/pypi/{package}/json" PYPI_ICON = "https://cdn.discordapp.com/emojis/766274397257334814.png" @@ -87,7 +87,7 @@ async def get_package_info(self, ctx: Context, package: str) -> None: log.trace(f"Error when fetching PyPI package: {response.status}.") if error: - error_message = await ctx.send(embed=embed) + error_message = await send_or_reply(ctx, embed) await wait_for_deletion(error_message, (ctx.author.id,), timeout=INVALID_INPUT_DELETE_DELAY) # Make sure that we won't cause a ghost-ping by deleting the message @@ -97,7 +97,7 @@ async def get_package_info(self, ctx: Context, package: str) -> None: await error_message.delete() else: - await ctx.send(embed=embed) + await send_or_reply(ctx, embed) async def setup(bot: Bot) -> None: From b5fdd8f8dfdfa89bcb169724fd9764232254ebbb Mon Sep 17 00:00:00 2001 From: Gokul A R Date: Thu, 20 Aug 2026 15:59:17 +0530 Subject: [PATCH 2/3] Update resources.py --- bot/exts/info/resources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/info/resources.py b/bot/exts/info/resources.py index f732fb186e..383b5fe3e4 100644 --- a/bot/exts/info/resources.py +++ b/bot/exts/info/resources.py @@ -57,7 +57,7 @@ async def resources_command(self, ctx: commands.Context, *, resource_topic: str url = f"{url}?topics={quote(to_kebabcase(resource_topic.splitlines()[0]))}" embed = Embed( - title="Resources", + title=f"Resources for: {resource_topic}" if resource_topic else "Resources", description=f"The [Resources page]({url}) on our website contains a list " f"of hand-selected learning resources that we " f"regularly recommend to both beginners and experts." From c427090981ac99708c20d8214b2d248460c18e5b Mon Sep 17 00:00:00 2001 From: Gokul A R Date: Thu, 20 Aug 2026 16:56:57 +0530 Subject: [PATCH 3/3] Update resources.py --- bot/exts/info/resources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/info/resources.py b/bot/exts/info/resources.py index 383b5fe3e4..1d43746bbb 100644 --- a/bot/exts/info/resources.py +++ b/bot/exts/info/resources.py @@ -57,7 +57,7 @@ async def resources_command(self, ctx: commands.Context, *, resource_topic: str url = f"{url}?topics={quote(to_kebabcase(resource_topic.splitlines()[0]))}" embed = Embed( - title=f"Resources for: {resource_topic}" if resource_topic else "Resources", + title=f"Resources for: {resource_topic.title()}" if resource_topic else "Resources", description=f"The [Resources page]({url}) on our website contains a list " f"of hand-selected learning resources that we " f"regularly recommend to both beginners and experts."