sern-handler / handler

Create your dream Discord bot!
https://sern.dev
MIT License
38 stars 9 forks source link

[BUG] sern Queueing/Awaiting commands #332

Closed Benzo-Fury closed 11 months ago

Benzo-Fury commented 1 year ago

Describe the bug

sern is currently queuing commands when they have been received.

To Reproduce

Steps to reproduce the behavior:

  1. Create a command that first defers the reply and waits any amount of time over 3 seconds before responding.
  2. Click on use another command while the new test one is "thinking" (deffered).
  3. See that the second command comes up as interaction failed and gives a "Unknown Interaction" error. (For a better example of the commands used see "Additional Notes" below)

Expected behavior

sern handler should not await/queue commands and should instead synchronous behaviour, executing multiple commands at the same type.

Versioning

NodeJS version: 18.14.2 DiscordJS version: 14.13.0 SernHandler version: 3.0.3 (but same outcome on 3.1)

Additional Notes

Better Example: User uses /test

await interaction.deferReply();
//do some stuff that takes longer than 3 seconds
await interaction.editReply('Ok dawg');

While /test has been deferred and not yet responded, a user uses /ping.

//sern stream awaits for the /test command to resolve/finish before running this one.
await interaction.reply(`Ping is ${client.ws.ping}`);
//discord.js throws an api error because this command has taken to long to respond^.
Murtatrxx commented 1 year ago

🧐

jacoobes commented 1 year ago

references #333