From 0f944eafe774864e7e1400be9812c71fc3911253 Mon Sep 17 00:00:00 2001 From: deadzilla Date: Wed, 22 Jul 2026 22:32:50 +0500 Subject: [PATCH] =?UTF-8?q?refactor:=20=D1=83=D0=B1=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D1=8C=20=D0=B4=D1=83=D0=B1=D0=BB=D0=B8=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B2=20TextHelpCommand.send=5Fbot=5Fhelp?= =?UTF-8?q?()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ветки if/else по cog_or_none выполняли идентичную логику. Объединены в один цикл — standalone-команды и команды из cog обрабатываются одинаково. --- bot.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/bot.py b/bot.py index a7d04f4..d703772 100644 --- a/bot.py +++ b/bot.py @@ -39,14 +39,7 @@ class TextHelpCommand(commands.HelpCommand): ) -> None: lines: list[str] = ["Доступные команды:"] - for cog_or_none, cog_commands in mapping.items(): - if cog_or_none is None: - # Standalone-команды (без cog) — показываем если не hidden - for command in cog_commands: - if not command.hidden: - desc = command.short_doc or "" - lines.append(f" !{command.name} - {desc}") - continue + for _cog_or_none, cog_commands in mapping.items(): for command in cog_commands: if not command.hidden: desc = command.short_doc or ""