async def callback(self, interaction: discord.Interaction):
name = self.children[0].value
age = self.children[1].value
nickname = self.children[2].value
youtube = self.children[3].value
twitch = self.children[4].value
uzer = interaction.user.mention
channel_id = 1219092823480074251
channel = interaction.guild.get_channel(channel_id)
formcount = await channel.history(limit=None).flatten()
form_count = sum(1 for message in formcount if message.embeds)
embed = discord.Embed(title=f"Заявка № ``{form_count}``",
description=f"**Как вас зовут?**\n**> Ваш ответ: — ``{name}``**\n**Сколько вам лет?**\n**> Ваш ответ: — ``{age}``**\n**Ваш ник**\n**> Ваш ответ: — ``{nickname}``**\n**Youtube**\n**> Ваш ответ: — ``{youtube}``**\n**Twitch/YouTube**\n**> Ваш ответ: — ``{twitch}``**",
colour=0x02f71f,
)
embed.set_footer(text=f"Ваша заявка отправлена, ожидайте. ID: {interaction.user.id}")
embed.set_author(name="1HP", icon_url="https://files.catbox.moe/qla4at.png")
cursor.execute('''
INSERT INTO forms (message_id, user_id, nickname, uzer)
VALUES (?, ?, ?, ?)
''', (channel.last_message_id, interaction.user.id, nickname, uzer))
conn.commit()
await interaction.user.send(embed=embed)
await interaction.response.send_message(embed=embed, ephemeral= True)
await channel.send(uzer, embed=embed, view=FormButtonReaction(interaction.user.id, nickname, uzer))
@button(label="Принять", emoji="✅", style=discord.ButtonStyle.blurple, custom_id="acceptbat")
async def AcceptButtonReactionCallback(self, button: discord.ui.Button, interaction: discord.Interaction):
print("Interaction Message ID:", interaction.message.id)
form_data = await self.get_form_data(interaction.message.id)
print("Form Data:", form_data)
if form_data:
print(form_data)
else:
await interaction.response.send_message("Данных нет", ephemeral=True)
Interaction Message ID: 1235561771629285408
Form Data: (4, 1235561771629285408, 612377208731992082, 'fghfgh', '<@612377208731992082>')
(4, 1235561771629285408, 612377208731992082, 'fghfgh', '<@612377208731992082>')
Ignoring exception in view <FormButtonReaction timeout=None children=2> for item <Button style=<ButtonStyle.primary: 1> url=None disabled=False label='Принять' emoji=<PartialEmoji animated=False name='✅' id=None> row=None>:
Traceback (most recent call last):
File "C:\Users\belog\Desktop\1hpbot\.venv\Lib\site-packages\discord\ui\view.py", line 426, in _scheduled_task
await item.callback(interaction)
File "c:\Users\belog\Desktop\1hpbot\commands.py", line 127, in AcceptButtonReactionCallback
if form_data: message_id, user_id, nickname, uzer = form_data
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 4)