From f578c3db9a3b8a2210e1a68b5c338f153681f204 Mon Sep 17 00:00:00 2001 From: Karlo Prikratki Date: Tue, 12 Aug 2025 02:57:11 +0200 Subject: [PATCH 1/5] fix fuzzy showing for blacklisted user --- redbot/core/commands/help.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/redbot/core/commands/help.py b/redbot/core/commands/help.py index 8ad7f4c5f3e..22a9575562d 100644 --- a/redbot/core/commands/help.py +++ b/redbot/core/commands/help.py @@ -752,6 +752,12 @@ async def command_not_found(self, ctx, help_for, help_settings: HelpSettings): """ Sends an error, fuzzy help, or stays quiet based on settings """ + blacklist: set[int] = await self.bot.get_blacklist().union( + await self.bot.get_blacklist(ctx.guild) + ) + if ctx.author.id in blacklist: + return + fuzzy_commands = await fuzzy_command_search( ctx, help_for, From 5805651819c0a6c0c8392093789c8f40bb2691ba Mon Sep 17 00:00:00 2001 From: Karlo Prikratki Date: Tue, 12 Aug 2025 03:05:05 +0200 Subject: [PATCH 2/5] uh oh --- redbot/core/_events.py | 6 ++++++ redbot/core/commands/help.py | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/redbot/core/_events.py b/redbot/core/_events.py index 5446a825f87..4da84b8553e 100644 --- a/redbot/core/_events.py +++ b/redbot/core/_events.py @@ -388,6 +388,12 @@ async def on_command_error(ctx, error, unhandled_by_cog=False): message = inline(_("Error in command '{command}'.")) await ctx.send(message.replace("{command}", ctx.command.qualified_name)) elif isinstance(error, commands.CommandNotFound): + blacklist: set[int] = await bot.get_blacklist().union( + await bot.get_blacklist(ctx.guild) + ) + if ctx.author.id in blacklist: + return + help_settings = await HelpSettings.from_context(ctx) fuzzy_commands = await fuzzy_command_search( ctx, diff --git a/redbot/core/commands/help.py b/redbot/core/commands/help.py index 22a9575562d..8ad7f4c5f3e 100644 --- a/redbot/core/commands/help.py +++ b/redbot/core/commands/help.py @@ -752,12 +752,6 @@ async def command_not_found(self, ctx, help_for, help_settings: HelpSettings): """ Sends an error, fuzzy help, or stays quiet based on settings """ - blacklist: set[int] = await self.bot.get_blacklist().union( - await self.bot.get_blacklist(ctx.guild) - ) - if ctx.author.id in blacklist: - return - fuzzy_commands = await fuzzy_command_search( ctx, help_for, From 79dd173bc93d2e378fb483edea20c2355d645bc1 Mon Sep 17 00:00:00 2001 From: Karlo Prikratki Date: Tue, 12 Aug 2025 03:09:39 +0200 Subject: [PATCH 3/5] listen --- redbot/core/_events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redbot/core/_events.py b/redbot/core/_events.py index 4da84b8553e..1480725d210 100644 --- a/redbot/core/_events.py +++ b/redbot/core/_events.py @@ -388,7 +388,7 @@ async def on_command_error(ctx, error, unhandled_by_cog=False): message = inline(_("Error in command '{command}'.")) await ctx.send(message.replace("{command}", ctx.command.qualified_name)) elif isinstance(error, commands.CommandNotFound): - blacklist: set[int] = await bot.get_blacklist().union( + blacklist: set[int] = (await bot.get_blacklist()).union( await bot.get_blacklist(ctx.guild) ) if ctx.author.id in blacklist: From 216c87c18e19e0f3018fb8a5bd95b131aaee4b79 Mon Sep 17 00:00:00 2001 From: Karlo Prikratki Date: Thu, 4 Sep 2025 12:31:18 +0200 Subject: [PATCH 4/5] replace blacklist-only checking with `message_eligible_as_command` --- redbot/core/_events.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/redbot/core/_events.py b/redbot/core/_events.py index 1480725d210..5e59d0f5c2e 100644 --- a/redbot/core/_events.py +++ b/redbot/core/_events.py @@ -388,10 +388,7 @@ async def on_command_error(ctx, error, unhandled_by_cog=False): message = inline(_("Error in command '{command}'.")) await ctx.send(message.replace("{command}", ctx.command.qualified_name)) elif isinstance(error, commands.CommandNotFound): - blacklist: set[int] = (await bot.get_blacklist()).union( - await bot.get_blacklist(ctx.guild) - ) - if ctx.author.id in blacklist: + if not bot.message_eligible_as_command(ctx.message): return help_settings = await HelpSettings.from_context(ctx) From 5c36b578a82fdf7c556197f2499a534552dfde7e Mon Sep 17 00:00:00 2001 From: Karlo Prikratki Date: Thu, 4 Sep 2025 12:47:46 +0200 Subject: [PATCH 5/5] await argh --- redbot/core/_events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redbot/core/_events.py b/redbot/core/_events.py index 5e59d0f5c2e..ae2830699c5 100644 --- a/redbot/core/_events.py +++ b/redbot/core/_events.py @@ -388,7 +388,7 @@ async def on_command_error(ctx, error, unhandled_by_cog=False): message = inline(_("Error in command '{command}'.")) await ctx.send(message.replace("{command}", ctx.command.qualified_name)) elif isinstance(error, commands.CommandNotFound): - if not bot.message_eligible_as_command(ctx.message): + if not await bot.message_eligible_as_command(ctx.message): return help_settings = await HelpSettings.from_context(ctx)