diff --git a/bot.py b/bot.py index 61c8847..a3bbf42 100644 --- a/bot.py +++ b/bot.py @@ -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() ):