how-to-avoid-to-exceed-rate-limit-by-using-discord-js-api code example
Example: how-to-avoid-to-exceed-rate-limit-by-using-discord-js-api
client.fetchMessageRateLimits()
.then(rateLimits => {
for (rateLimit of rateLimits) {
if (rateLimit.remaining === 0) {
const msUntilReset = rateLimit.reset - Date.now();
commandHandler.ignoreChannel(rateLimit.channelId, msUntilReset);
}
}
});