23 lines
639 B
TypeScript
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!`)
|
|
}
|
|
}
|