added mognodb database

This commit is contained in:
2025-01-30 20:15:50 +01:00
parent c913661109
commit 8fd4ed237b
11 changed files with 326 additions and 7 deletions
+9 -1
View File
@@ -1,9 +1,17 @@
const { Events } = require('discord.js');
const { connectToDatabase } = require('../db.js');
module.exports = {
name: Events.ClientReady,
once: true,
execute(client) {
async execute(client) {
console.log(`Ready! Logged in as ${client.user.tag}`);
try {
await connectToDatabase();
} catch (err) {
console.error("MongoDB connection error:", err);
}
},
};