Удалены избыточные проверки ctx в on_command_error (ctx всегда передан discord.py)

This commit is contained in:
deadzilla 2026-07-14 22:48:30 +05:00
parent bb9e50fb05
commit d85f28f042

5
bot.py
View File

@ -156,7 +156,7 @@ class BotRunner:
return
# Терминал — детали для разработчика
cmd_name = ctx.command.name if ctx and ctx.command else "?"
cmd_name = ctx.command.name if ctx.command else "?"
logger.error(
"Ошибка команды %s: %s",
cmd_name,
@ -168,8 +168,7 @@ class BotRunner:
# ctx.interaction есть только у slash-команд (AutoshardedInteractionContext)
# Для текстовых команд (!prefix) атрибута нет — используем hasattr
if (
ctx
and hasattr(ctx, "interaction")
hasattr(ctx, "interaction")
and ctx.interaction
and ctx.interaction.response.is_done()
):