import { BotEmitter, initCommands } from "@wackford/mod.ts"; import { Intents } from "@wackford/discordeno.ts"; import initLocalCommands from "./commands/index.ts"; import initOnMessage from "./events/onMessage.ts"; import initAIs from "./ai/index.ts"; import initDB from "./database.ts"; import config from "./config.ts"; import initSocket from "./socket.ts"; export class GoofyAhhException extends Error { constructor(message: string) { super(message); this.name = "GoofyAhhException"; } } await initDB(); if (config.websocket.enabled) initSocket(config.websocket.port); initOnMessage(); initLocalCommands(); initCommands(); initAIs(); await BotEmitter.emit("start", { token: Deno.env.get("TOKEN") ?? config.discord.token ?? (() => { throw new GoofyAhhException("No token?"); })(), intents: Intents.Guilds | Intents.GuildMessages | Intents.MessageContent, });