zfbx / zdiscord

A Discord bot that runs in FiveM for the purpose of whitelisting, moderation and utilties using discord.js
Other
211 stars 79 forks source link

[Every commands fail after first] #99

Closed Simomagy closed 1 year ago

Simomagy commented 1 year ago

Describe the bug After the first command execution (regardless of what is it) the script doesn't work anymore and throws the error below until resource is restarted.

To Reproduce Steps to reproduce the behavior:

  1. Start resource
  2. Perform any command from discord
  3. Perform another command
  4. See error

Expected behavior I shouldn't restart the resource after every command i perform :))

Error (node:5152) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown interaction at RequestHandler.execute (C:\Users\Administrator\Desktop\Eden3.0\server-data\resources[others]\zdiscord\node_modules\discord.js\src\rest\RequestHandler.js:352:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async RequestHandler.push (C:\Users\Administrator\Desktop\Eden3.0\server-data\resources[others]\zdiscord\node_modules\discord.js\src\rest\RequestHandler.js:53:14) at async CommandInteraction.reply (C:\Users\Administrator\Desktop\Eden3.0\server-data\resources[others]\zdiscord\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:99:5) (Use FXServer --trace-warnings ... to show where the warning was created) (node:5152) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

Information:

Additional context Nothing more

zfbx commented 1 year ago

are you running txadmin and if so is it using the same token?

Simomagy commented 1 year ago

Oh right sorry for the bad report, I forgot about it and thank you for the reminder

zfbx commented 1 year ago

was that the issue?

Simomagy commented 1 year ago

I'm gonna check today, I'll update you as soon as possible

Simomagy commented 1 year ago

Yep it was the problem thank you again for the help