relay/src/bot/events/ready.ts
Corban-Lee Jones 5ad695059e
All checks were successful
Build / build (push) Successful in 59s
feat: add proper logging with winston
2025-05-16 23:22:04 +01:00

23 lines
639 B
TypeScript

import { ActivityType } from "discord.js";
import Event from "@bot/components/event";
import DiscordBot from "@bot/bot";
import { getLogger } from "src/log";
const logger = getLogger(__filename);
export default class Ready extends Event {
name = "ready";
once = true;
async execute(client: DiscordBot): Promise<void> {
if (!client.user) {
throw new Error("Discord client is not truthy");
}
await client.interactions.deploy();
client.user.setActivity("new sources", {type: ActivityType.Watching});
logger.info(`Discord Bot ${client.user.displayName} is online!`)
}
}