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:
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 { 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 => {
|
||||
|
|
Loading…
Add table
Reference in a new issue