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 toolkit11mo 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!
536b656c6c79
536b656c6c79OP11mo ago
@Sky
monbrey
monbrey11mo ago
We would only retry a webhook if it failed for some reason How are the contents different?
536b656c6c79
536b656c6c79OP11mo ago
It are 2 different embeds With 2 totally different messages in it
536b656c6c79
536b656c6c79OP11mo ago
Example Is there a way to disable this?
monbrey
monbrey11mo 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
536b656c6c79
536b656c6c79OP11mo 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
monbrey11mo ago
Possibly
Dominik
Dominik11mo 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
536b656c6c79
536b656c6c79OP11mo ago
😢
Dominik
Dominik11mo ago
im investigating rn dw
536b656c6c79
536b656c6c79OP11mo 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
Dominik11mo ago
I fixed it
536b656c6c79
536b656c6c79OP11mo ago
how
Dominik
Dominik11mo ago
This is why im the CEO of the company
536b656c6c79
536b656c6c79OP11mo ago
lmao
Dominik
Dominik11mo ago
Yea well actually it was pretty simple
536b656c6c79
536b656c6c79OP11mo ago
oh goddd always the easy stuff
Dominik
Dominik11mo ago
kek I rebooted my other server and didnt start any process before letting dms run
536b656c6c79
536b656c6c79OP11mo ago
other server ???
Dominik
Dominik11mo ago
Dont ask me why but for some reason the other server caused it to double send
536b656c6c79
536b656c6c79OP11mo ago
so I was right
Dominik
Dominik11mo ago
No clue how that works without a token but bro
536b656c6c79
536b656c6c79OP11mo 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
Dominik11mo ago
But it shouldnt start the bot if there is no token provided why would the webhook client run
536b656c6c79
536b656c6c79OP11mo ago
there is one provided just an old one because webhookclient gets the token and id from the webhookcache db and thats enough
Dominik
Dominik11mo ago
but shouldnt there be like the discord api saying yo bro dont connect
536b656c6c79
536b656c6c79OP11mo ago
you don't need a client token no because sending is not an api call its just a webhookg post request
536b656c6c79
536b656c6c79OP11mo ago
No description
Dominik
Dominik11mo 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
536b656c6c79
536b656c6c79OP11mo ago
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
536b656c6c79
536b656c6c79OP11mo ago
idk but I think we instantiate the handlers before logging in
Dominik
Dominik11mo ago
you a smart one If this was the reason for all the pain for the last few months I gotta cry
536b656c6c79
536b656c6c79OP11mo ago
well it was probably
Dominik
Dominik11mo ago
We rewrote the whole systme as a microservice basically for nothing kek
536b656c6c79
536b656c6c79OP11mo ago
noo noo its good
Dominik
Dominik11mo ago
yea it is but damnnn
536b656c6c79
536b656c6c79OP11mo ago
now we can expand great work 🤝 I write a hotfix give me a second
Dominik
Dominik11mo 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
536b656c6c79
536b656c6c79OP11mo ago
pm2 🤮 fix announcement?
Dominik
Dominik11mo ago
yea all my homies hate pm2 but its easy to setup
536b656c6c79
536b656c6c79OP11mo ago
true but still
Dominik
Dominik11mo ago
ohh yea gotcha go for it sir
Want results from more Discord servers?
Add your server