📜  how-to-avoid-to-exceed-rate-limit-by-using-discord-js-api - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:53.880000             🧑  作者: Mango

代码示例1
client.fetchMessageRateLimits()
  .then(rateLimits => {
    for (rateLimit of rateLimits) {
      if (rateLimit.remaining === 0) {
        const msUntilReset = rateLimit.reset - Date.now();
        commandHandler.ignoreChannel(rateLimit.channelId, msUntilReset);
      }
    }
  });