disnake реакция на сообщение
Я пытаюсь понять как сделать реакцию на сообщение, но не как не получается, ищу в документации disnake, ничего. Одно и тоже ошибка
@bot.slash_command()
async def reaction(inter):
emoji = "?"
message = await inter.response.send_message("Окей")
await message.add_reaction(emoji)
Ошибка:
Ignoring exception in slash command 'reaction':
Traceback (most recent call last):
File "/home/runner/ThinWirelessMigration/venv/lib/python3.10/site-packages/disnake/ext/commands/slash_core.py", line 730, in invoke
await call_param_func(self.callback, inter, self.cog, **kwargs)
File "/home/runner/ThinWirelessMigration/venv/lib/python3.10/site-packages/disnake/ext/commands/params.py", line 1022, in call_param_func
return await maybe_coroutine(safe_call, function, **kwargs)
File "/home/runner/ThinWirelessMigration/venv/lib/python3.10/site-packages/disnake/utils.py", line 599, in maybe_coroutine
return await value
File "main.py", line 194, in reaction
await message.add_reaction(emoji)
AttributeError: 'NoneType' object has no attribute 'add_reaction'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/runner/ThinWirelessMigration/venv/lib/python3.10/site-packages/disnake/ext/commands/interaction_bot_base.py", line 1353, in process_application_commands
await app_command.invoke(interaction)
File "/home/runner/ThinWirelessMigration/venv/lib/python3.10/site-packages/disnake/ext/commands/slash_core.py", line 739, in invoke
raise CommandInvokeError(exc) from exc
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'add_reaction'
Ответы (1 шт):
Автор решения: Entar
→ Ссылка
Ты не можешь ставить реакцию на слеш-команду, ее как таковой нет в чате, из-за чего выдается ошибка, что такое действие невозможно