So I Am Making A Discord Bot and i am stuck my database is not connecting here is the code:
const mongoose = require("mongoose");
const { Database } = require("../../config.json");
module.exports = {
name: "ready",
once: true,
/**
* @param {Client} client
*/
execute(client) {
console.log("O Bot X Leci Na Discorda 🪐!")
client.user.setActivity("Twitch", {type: "STREAMING", url: "https://www.twitch.tv/olekiox"})
if(!Database) return;
mongoose.connect(Database, {
useNewUrlParser: true,
useUndenifiedTopology: true
}).then(() => {
console.log("O Bot X Jest Połączony Z Databasem 💻")
}).catch((err) => {
console.log(err)
});
}
}
idk what is wrong help pls