Tracing activity and ratelimits

Hi, I would like to be able to collect information on what all a bot is doing over the API (what endpoints are being hit and request duration etc) and be able to understand things like when ratelimits are being hit. This would help me ensure all is working well with my bot and triage things like hangs. Does Discord.JS support any means of collecting diagnostic information like this? Alternatively, is there any way to easily hook into Discord.JS internals for this?
3 Replies
d.js toolkit
d.js toolkit3mo 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!
Harnes
Harnes3mo ago
You "can't" hit ratelimit as long as you use DiscordJS REST for any request u make - REST will throttle the requests just to avoid hitting ratelimit whenever possible I mean there's some exceptions where u still hit it but there's nothing you can do You can still listen to events such as rateLimited and response from <REST>.on() class or <Client>.rest.on() to track your requests You can see a full list of events here
jr
jrOP3mo ago
Right, I guess I didn't word this perfectly precicely. I want to know when throttling happens. Thanks that's super helpful, I'll check it out
Want results from more Discord servers?
Add your server