408 Request Timeout when sending messages

Hello! Some shards of my bots regularly experience that single messages can't be sent or are sent but it still throws the following error, letting my bot think the message was not sent:
DiscordAPIError[undefined]: No Description
{"requestBody":{"files":[],"json":{"content":"Hello!","tts":false,"embeds":[],"components":[],"attachments":[]}},"rawError":{},"status":408,"method":"POST","url":"/api/v10/channels/xxxx2460659311xxxxx/messages"}
DiscordAPIError[undefined]: No Description
{"requestBody":{"files":[],"json":{"content":"Hello!","tts":false,"embeds":[],"components":[],"attachments":[]}},"rawError":{},"status":408,"method":"POST","url":"/api/v10/channels/xxxx2460659311xxxxx/messages"}
Is this something that can be "fixed" by setting client.rest.timeout to something larger than 15_000? Or is this a Discord issue I can't fix myself? I do use nirn-proxy, maybe this is part of the issue? - Just checked, nirn-proxy's monitoring does not say anything about 408 requests..., I guess this is a proxy issue then?
5 Replies
d.js toolkit
d.js toolkit8mo 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!
Toast
Toast8mo ago
i believe 'Request Timeout' is caused by slow connection but you can adjust REST timeout to something higher than 15 seconds, but might be Discord side.
d.js docs
d.js docs8mo ago
AbortError: The user aborted a request. A request took longer than the specified timeout (15 seconds default), and was aborted to not lock up the request handler. - This can be caused by an internal server error on Discord's side, or just a slow connection. - In case of a slow connection, the timeout option in RESTOptions can be increased to prevent future AbortErrors.
Toast
Toast8mo ago
this might be similar to yours but shows the reasons why.
Xge
XgeOP8mo ago
I'll increase it to 30 seconds for now, thanks
Want results from more Discord servers?
Add your server