Queuing operations with lower priority than usual

Hey, I'd like to be able to schedule some API operations in a way that they don't block new commands from executing. Does Discord.JS use any type of priority queue for that? I'd like it to process commands etc. first, and then doing the scheduled stuff (e.g. processing older messages posted while the bot was offline), so that it doesn't run into rate limiting with responding to commands.
4 Replies
Sukadia
Sukadia3y ago
seems like this question was never answered and i'm experiencing a similar issue; i use up the ratelimit when sending polls to each server at a specific time, and slash command replies tend to drop much more often during that time since they take longer than 3 seconds. is there anyway to prioritize the replies?
Octoboomer
Octoboomer3y ago
Rate limits and processing api requests is handled by the rest package By default, all requests are processed sequentially
Sukadia
Sukadia3y ago
is there any documentation on changing that? rest package doesn't seem to have anything here https://discord.js.org/#/docs/rest/main/general/welcome. otherwise, any workaround?
Octoboomer
Octoboomer3y ago
The other packages don’t use that site anymore. https://discordjs.dev/docs/packages/rest/1.4.0
discord.js
discord.js
discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.

Did you find this page helpful?