diff --git a/bot.py b/bot.py index 6fef1e4..564255c 100644 --- a/bot.py +++ b/bot.py @@ -51,13 +51,16 @@ async def on_command_error(ctx, error): return # Терминал — детали для разработчика + cmd_name = ctx.command.name if ctx and ctx.command else '?' logger.error( - f"Ошибка команды {ctx.command.name if ctx else '?'}: {error}", + f"Ошибка команды {cmd_name}: {error}", exc_info=True, ) # Discord — только если команда не ответила сама - if ctx and ctx.interaction and ctx.interaction.response.is_done(): + # ctx.interaction есть только у slash-команд (AutoshardedInteractionContext) + # Для текстовых команд (!prefix) атрибута нет — используем hasattr + if ctx and hasattr(ctx, 'interaction') and ctx.interaction and ctx.interaction.response.is_done(): return try: