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