Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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);
      }
    }
  });
Source by github.com #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
3+1 =