Skip to content

Commit

Permalink
Log RESTEvents implicated by SequentialHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinlul committed Dec 1, 2024
1 parent 8050f19 commit 0314a8e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/events/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, DiscordAPIError, RESTJSONErrorCodes } from "discord.js";
import { Client, DiscordAPIError, RESTEvents, RESTJSONErrorCodes } from "discord.js";
import { CommandSupport } from "../Command";
import * as commands from "../commands";
import { Participant, RegisterMessage } from "../database/orm";
Expand All @@ -15,6 +15,8 @@ import * as messageDelete from "./messageDelete";
const logger = getLogger("events");

export function registerEvents(bot: Client, prefix: string, support: CommandSupport): void {
bot.on(RESTEvents.Debug, logger.verbose);
bot.on(RESTEvents.RateLimited, logger.warn);
bot.on("warn", logger.warn);
bot.on("error", logger.error);
bot.on("shardReady", shard => logger.notify(`Shard ${shard} ready`));
Expand Down

0 comments on commit 0314a8e

Please sign in to comment.