A powerful and extendable Discord bot, with it's own module system :3 thevoid.cafe/projects/voidy

♻️ Replace old handlers in index.ts

Jo fd395306 11128534

+5 -5
+5 -5
src/index.ts
··· 1 1 import { GatewayIntentBits } from "discord.js"; 2 2 import { VoidyClient } from "./utils/classes/VoidyClient.ts"; 3 - import { handleCommands } from "./handlers/handleCommand.ts"; 4 - import { handleEvents } from "./handlers/handleEvents.ts"; 3 + import { CommandHandler } from "./handlers/CommandHandler.ts"; 4 + import { EventHandler } from "./handlers/EventHandler.ts"; 5 5 import * as mongoose from "mongoose"; 6 6 7 7 // Create bot client instance ··· 16 16 Deno.exit(1); 17 17 }); 18 18 19 - // Handle commands and events 20 - await handleCommands(client, "src/commands"); 21 - await handleEvents(client, "src/events"); 19 + // Handle standalone commands and events 20 + await CommandHandler.loadCommands(client, ["src/commands"]); 21 + await EventHandler.loadEvents(client, ["src/events"]); 22 22 23 23 // Login using the specified token 24 24 client.login(Deno.env.get("BOT_TOKEN")).then(() => console.log("[Voidy] Successfully logged in!"));