#How can I get the precise time at which a request is sent?

14 messages · Page 1 of 1 (latest)

faint crag
#

I'm looking to debug an issue and, for that, I need to know the exact time at which discord.js sends the request to Discord and the exact time it's received at, as well as any rateLimits that occurred in the way. I'm not too familiar with rest so I'd like to know if this is possible and where I can see the history of rateLimits on my code without having to listen to the rateLimit event from rest

graceful narwhal
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

simple night
#

There is no history of rate limits stored anywhere

#

rest events are the closest you'll get unless you want to start diving into internal source code to add additional debugging

bright palm
#

response event probably is your best bet here

graceful quartz
#

The only time you can know for certain is the time the bot sends a ping to the server and the time the pong is received by the bot.

faint crag
faint crag
faint crag
#

seems like the response event is emitted when the response is received. I'll try to use that and the rateLimit event to see if I can figure something out

#

also @crisp moon since you replied to the issue, is that separate handler you mentioned something you're gonna PR into rest or is it something you will use to test yourself?

bright palm
#

If you‘re talking about the burst handler, that already has a PR

crisp moon
#

you can also use diagnostics channel to see when undici sends requests

faint crag