Bot seems to constantly reupload files even after one has uploaded?
Re-tag of this as it still occurs with latest DiscordJS
7 Replies
- 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!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 isexpected result
bot uploads this file once without any failures or catches.
current result
along with
in console.
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