mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 14:11:50 +00:00
Fix 429/rate limit logging
This commit is contained in:
parent
b06e51f25c
commit
ef118437f5
1 changed files with 8 additions and 3 deletions
|
@ -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 yaml from "js-yaml";
|
||||||
import { Knub, PluginError } from "knub";
|
import { Knub, PluginError } from "knub";
|
||||||
import { PluginLoadError } from "knub/dist/plugins/PluginLoadError";
|
import { PluginLoadError } from "knub/dist/plugins/PluginLoadError";
|
||||||
|
@ -178,8 +178,13 @@ connect().then(async () => {
|
||||||
});
|
});
|
||||||
client.setMaxListeners(200);
|
client.setMaxListeners(200);
|
||||||
|
|
||||||
client.on("rateLimit", rateLimitData => {
|
client.on(Constants.Events.DEBUG, errorText => {
|
||||||
logger.info(`[429] ${JSON.stringify(rateLimitData)}`);
|
if (!errorText.indexOf("429")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
|
console.warn(errorText);
|
||||||
});
|
});
|
||||||
|
|
||||||
client.on("error", err => {
|
client.on("error", err => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue