Удалены избыточные проверки ctx в on_command_error (ctx всегда передан discord.py)
This commit is contained in:
parent
bb9e50fb05
commit
d85f28f042
5
bot.py
5
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()
|
||||
):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user