discord.py | Ошибка взаимодействия с кнопкой
Создаю бота на заказ, появилась такая проблема. Пробовал исправить через ChatGPT, но все также осталась Ошибка взаимодействия. Discord для связи, если нужно: gigachad#4072
Код команды:
ID = '1091660072507146340'
@bot.command()
async def order(ctx, seller: discord.Member, item: str):
await ctx.author.send(f"Ваш заказ на {item} принят, ожидайте.")
embed = discord.Embed(title=f"Поступил новый заказ от {ctx.author}", description=f"Товар: {item}")
accept_button = discord.ui.Button(label="Принять", style=discord.ButtonStyle.green)
decline_button = discord.ui.Button(label="Отклонить", style=discord.ButtonStyle.red)
view = discord.ui.View(timeout=None)
view.add_item(accept_button)
view.add_item(decline_button)
message = await seller.send(embed=embed, view=view)
async def accept_callback(interaction: discord.Interaction):
channel = bot.get_channel(ID) # < - - - ID HERE
await channel.send(f"{seller} принял заказ от {ctx.author} на {item}.")
await ctx.author.send(f"Ваш заказ принял {seller}. Свяжитесь с ним.")
async def decline_callback(interaction: discord.Interaction):
reason = await bot.wait_for("message", check=lambda m: m.author == seller)
channel = bot.get_channel(ID) # < - - - ID HERE
await channel.send(f"{seller} отклонил заказ от {ctx.author} на {item} по причине {reason.content}.")
accept_button.callback = accept_callback
decline_button.callback = decline_callback
await view.wait()