eibex/reaction-light

Bot DMs result in `The application did not respond`

Closed this issue · 3 comments

eibex commented

Describe the bug

Sending a slash command via DM to the bot results in The application did not respond.
Tentative fixes in #134 and 3e15cf8 didn't work. The error raised is indeed disnake.ext.commands.errors.NoPrivateMessage but it isn't caught properly.

To Reproduce

  • DM the bot with a slash command

Expected behavior

no-dm message reply.

Server:

  • OS: Linux-based, Docker
  • Python version: 3.12
  • disnake version: 2.9.1

Traceback

Ignoring exception in slash command 'admin':
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/disnake/ext/commands/interaction_bot_base.py", line 1378, in process_application_commands
    await app_command.invoke(interaction)
  File "/usr/local/lib/python3.12/site-packages/disnake/ext/commands/slash_core.py", line 717, in invoke
    await self.prepare(inter)
  File "/usr/local/lib/python3.12/site-packages/disnake/ext/commands/base_core.py", line 314, in prepare
    if not await self.can_run(inter):
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/disnake/ext/commands/base_core.py", line 623, in can_run
    return await async_all(predicate(inter) for predicate in predicates)  # type: ignore
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/disnake/utils.py", line 573, in async_all
    for elem in gen:
  File "/usr/local/lib/python3.12/site-packages/disnake/ext/commands/base_core.py", line 623, in <genexpr>
    return await async_all(predicate(inter) for predicate in predicates)  # type: ignore
                           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/disnake/ext/commands/core.py", line 2448, in predicate
    raise NoPrivateMessage
disnake.ext.commands.errors.NoPrivateMessage: This command cannot be used in private messages.

Just update your image. It works properly on my local container.

eibex commented

Interesting, I might have had an issue with my docker manager. I will test again tomorrow

eibex commented

It didn't recreate a new image after all.