SpaceSocial icon indicating copy to clipboard operation
SpaceSocial copied to clipboard

Bug

Open Bubbleyur opened this issue 1 year ago • 3 comments

just change the loadDatabase.js and loadCommand.js

---------for loadDatabase.js

const mongoose = require('mongoose');
const { MONGO_URI } = require('../settings/config.js');
const { white, green } = require('chalk');

mongoose.set('strictQuery', true)
module.exports = async () => {
    try {
        await mongoose.connect(MONGO_URI);
        console.log(white('[') + green('INFO') + white('] ') + green('Database ') + white('Events') + green(' Loaded!'));
    } catch (error) {
        console.log(error);
    }
} 

---------for loadCommand.js

const { white, green } = require("chalk");
const { readdirSync } = require('fs');

module.exports = async (client) => {
    readdirSync("./commands/").map(async dir => {
        const commands = readdirSync(`./commands/${dir}/`).map(async (cmd) => {
            const pull = require(`../commands/${dir}/${cmd}`)
            client.slash.set(pull.name, pull);
            if (pull.aliases) {
                pull.aliases.map(x => client.slash.set(x, pull));
            }
        });
    })
    console.log(white('[') + green('INFO') + white('] ') + green('SlashCommand ') + white('Events') + green(' Loaded!'));
}

Bubbleyur avatar Mar 21 '23 09:03 Bubbleyur