Bot seems to constantly reupload files even after one has uploaded?

Re-tag of this as it still occurs with latest DiscordJS
7 Replies
d.js toolkit
d.js toolkit4w ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Nixxxxxx
NixxxxxxOP4w ago
extended post from this, last year https://discord.com/channels/222078108977594368/1123537874747408445/1123537874747408445 PS C:-\servers\e2b22ebe> npm list discord.js -@ C:-\servers\e2b22ebe -- [email protected] node v20.17.0 example code ```js Message.reply({ content: '', files: [/videos/${filename}`], }) ``` example file is
Nixxxxxx
NixxxxxxOP4w ago
Nixxxxxx
NixxxxxxOP4w ago
expected result bot uploads this file once without any failures or catches. current result
Nixxxxxx
NixxxxxxOP4w ago
No description
Nixxxxxx
NixxxxxxOP4w ago
along with
DOMException [AbortError]: This operation was aborted
at new DOMException (node:internal/per_context/domexception:53:5)
at AbortController.abort (node:internal/abort_controller:391:18)
at Timeout.<anonymous> (C:\servers\e2b22ebe\node_modules\@discordjs\rest\dist\index.js:680:47)
at listOnTimeout (node:internal/timers:581:17)
at process.processTimers (node:internal/timers:519:7)
DOMException [AbortError]: This operation was aborted
at new DOMException (node:internal/per_context/domexception:53:5)
at AbortController.abort (node:internal/abort_controller:391:18)
at Timeout.<anonymous> (C:\servers\e2b22ebe\node_modules\@discordjs\rest\dist\index.js:680:47)
at listOnTimeout (node:internal/timers:581:17)
at process.processTimers (node:internal/timers:519:7)
in console.
duck
duck4w ago
seems the source of the issue was already explained in your previous post, so skipping right to solutions: we now have the nonce and enforceNonce options when sending a message for example, you can use SnowflakeUtil.generate() to generate a snowflake, use that for the nonce, and specify enforceNonce: true if after implementing a nonce, the issue still persists, please share more of your current code
If [enforceNonce is] true and nonce is present, it will be checked for uniqueness in the past few minutes. If another message was created by the same author with the same nonce, that message will be returned and no new message will be created.
-dapi docs

Did you find this page helpful?