Recieved 1 instruction to send a webhook but it send twice with different contents.

We have a system in place that sends instructions to the bot with webhook id and token. Upon recieving the instructions the bot handles this perfectly but somehow send some webhooks twice with different contents. Does Discord.js do something behind the scenes to retry webhooks? We are using discordjs/rest v2.2.0 and discord.js v14.14.1 Node LTS 1.18
44 Replies
d.js toolkit
d.js toolkit5mo 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!
skeleton man
skeleton man5mo ago
@Sky
monbrey
monbrey5mo ago
We would only retry a webhook if it failed for some reason How are the contents different?
skeleton man
skeleton man5mo ago
It are 2 different embeds With 2 totally different messages in it
skeleton man
skeleton man5mo ago
Example Is there a way to disable this?
monbrey
monbrey5mo ago
Probably not Usually failed would throw a discord.js error Or a Discord API error This just looks like it's executing twice, your bot is literally sending two different payloads A retried API call wouldn't be different
skeleton man
skeleton man5mo ago
I don't have access to the system the bot runs on but its possible that maybe the bot has 2 instances running? The instruction queue only sends the first message (first embed)
monbrey
monbrey5mo ago
Possibly
Dominik
Dominik5mo ago
I dont think thats the case as it doesnt send two for all of the servers + if it was running twice tons of interactions would fail/be unknown
skeleton man
skeleton man5mo ago
😢
Dominik
Dominik5mo ago
im investigating rn dw
skeleton man
skeleton man5mo ago
yea got some stuff to do can join later if you're still busy I can write up a quick doc of what i've tested before if needed
Dominik
Dominik5mo ago
I fixed it
skeleton man
skeleton man5mo ago
how
Dominik
Dominik5mo ago
This is why im the CEO of the company
skeleton man
skeleton man5mo ago
lmao
Dominik
Dominik5mo ago
Yea well actually it was pretty simple
skeleton man
skeleton man5mo ago
oh goddd always the easy stuff
Dominik
Dominik5mo ago
kek I rebooted my other server and didnt start any process before letting dms run
skeleton man
skeleton man5mo ago
other server ???
Dominik
Dominik5mo ago
Dont ask me why but for some reason the other server caused it to double send
skeleton man
skeleton man5mo ago
so I was right
Dominik
Dominik5mo ago
No clue how that works without a token but bro
skeleton man
skeleton man5mo ago
with the second server omg its a webhookclient you don't need a token and the token fails to set for the thread so thats why it errors but still sends
Dominik
Dominik5mo ago
But it shouldnt start the bot if there is no token provided why would the webhook client run
skeleton man
skeleton man5mo ago
there is one provided just an old one because webhookclient gets the token and id from the webhookcache db and thats enough
Dominik
Dominik5mo ago
but shouldnt there be like the discord api saying yo bro dont connect
skeleton man
skeleton man5mo ago
you don't need a client token no because sending is not an api call its just a webhookg post request
skeleton man
skeleton man5mo ago
No description
Dominik
Dominik5mo ago
Yea yea but like if the process has no token it cant log in which is why the webhook thing shouldnt be started either
skeleton man
skeleton man5mo ago
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
skeleton man
skeleton man5mo ago
idk but I think we instantiate the handlers before logging in
Dominik
Dominik5mo ago
you a smart one If this was the reason for all the pain for the last few months I gotta cry
skeleton man
skeleton man5mo ago
well it was probably
Dominik
Dominik5mo ago
We rewrote the whole systme as a microservice basically for nothing kek
skeleton man
skeleton man5mo ago
noo noo its good
Dominik
Dominik5mo ago
yea it is but damnnn
skeleton man
skeleton man5mo ago
now we can expand great work 🤝 I write a hotfix give me a second
Dominik
Dominik5mo ago
a hotfix? for what there is no fix Oh btw I still dont know which of the pm2 processes this is but ill check
skeleton man
skeleton man5mo ago
pm2 🤮 fix announcement?
Dominik
Dominik5mo ago
yea all my homies hate pm2 but its easy to setup
skeleton man
skeleton man5mo ago
true but still
Dominik
Dominik5mo ago
ohh yea gotcha go for it sir