3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Fix 429/rate limit logging

This commit is contained in:
Dragory 2021-08-18 23:20:31 +03:00
parent b06e51f25c
commit ef118437f5
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -1,4 +1,4 @@
import { Client, Intents, TextChannel, ThreadChannel } from "discord.js";
import { Client, Constants, Intents, TextChannel, ThreadChannel } from "discord.js";
import yaml from "js-yaml";
import { Knub, PluginError } from "knub";
import { PluginLoadError } from "knub/dist/plugins/PluginLoadError";
@ -178,8 +178,13 @@ connect().then(async () => {
});
client.setMaxListeners(200);
client.on("rateLimit", rateLimitData => {
logger.info(`[429] ${JSON.stringify(rateLimitData)}`);
client.on(Constants.Events.DEBUG, errorText => {
if (!errorText.indexOf("429")) {
return;
}
// tslint:disable-next-line:no-console
console.warn(errorText);
});
client.on("error", err => {