cdcommands
Version:
An advanced handler for Discord.js Bots with TypeScript and JavaScript support.
23 lines (21 loc) • 530 B
JavaScript
const { connect } = require("mongoose");
const colors = require("colors");
/** @param {string} mongoURI */
module.exports = async function (mongoURI) {
connect(
mongoURI,
{
useFindAndModify: false,
useNewUrlParser: true,
useUnifiedTopology: true,
},
(err) => {
if (err) throw err;
else
console.log(
`${colors.brightGreen("[DATABASE]")}`.white +
colors.white(" Successfully connected to the database!"),
);
},
);
};