A powerful and extendable Discord bot, with it's own module system :3 thevoid.cafe/projects/voidy
at develop 1.0 kB view raw
1import { GatewayIntentBits } from "discord.js"; 2import { VoidyClient } from "@voidy/framework"; 3import { connect } from "mongoose"; 4 5//=============================================== 6// Discord client initialization 7//=============================================== 8 9// Client initialization with intents and stuff... 10const client = new VoidyClient({ 11 intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages], 12 developers: Bun.env.BOT_ADMINS?.split(",") ?? ["423520077246103563"], 13 logChannelId: "1451025628206731459" 14}); 15 16// Database URI validation and connection check 17if (!Bun.env.DB_URI) throw new Error("[Voidy] Missing database URI"); 18await connect(Bun.env.DB_URI) 19 .then(() => { 20 console.log("Connected to database"); 21 }) 22 .catch((error) => { 23 console.error("Failed to connect to database:", error); 24 }); 25 26// Token validation and client start 27if (!Bun.env.BOT_TOKEN) throw new Error("[Voidy] Missing bot token"); 28await client.start(Bun.env.BOT_TOKEN, `${import.meta.dirname}/modules`);