Skip to content

[BUG] Autodefer not always working #1021

@JoinChang

Description

@JoinChang

Describe the bug.

This happens when the command is not responded to for three seconds.
image

Example: https://autocode.com/autocode/threads/how-to-avoid-timeout-errors-when-responding-to-discord-interactions-tutorial-9f4b312c/

List the steps.

  1. Create a slash command and listen to it
  2. Create a time-consuming method
  3. Command is processing, but few seconds later, Discord returns a new interaction
  4. Library doesn't process the interaction normally, returned: Unknown interaction, with code '10062' and severity '40'

What you expected.

Should listen for timeout events.

What you saw.

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/interactions/client/models/command.py", line 920, in wrapper
    raise e
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/interactions/client/models/command.py", line 906, in wrapper
    return await coro(ctx, *args, **kwargs)
  File "/Volumes/NTFS/LxBot-Yukimi-Project/lxbot-core/core/adapters/discord/__init__.py", line 39, in _
    await option["func"](self, ctx, **kwargs) # 回调函数
  File "/Volumes/NTFS/LxBot-Yukimi-Project/lxbot-core/modules/bilibili/main.py", line 19, in _
  File "/Volumes/NTFS/LxBot-Yukimi-Project/lxbot-core/core/adapters/discord/__init__.py", line 18, in reply
    await command_send(ctx, **MessageParser().parseArguments(content))
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/interactions/ext/files/files.py", line 356, in command_send
    await Inter_Request.create_interaction_response(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/interactions/ext/files/files.py", line 63, in create_interaction_response
    return await self._req.request(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/interactions/api/http/request.py", line 174, in request
    raise LibraryException(
interactions.api.error.LibraryException: An error occurred:
Unknown interaction, with code '10062' and severity '40'

What version of the library did you use?

release

Version specification

4.3.0

Code of Conduct

  • I agree to follow the contribution requirements.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions