mirror of
https://github.com/ION606/selmerBot.git
synced 2026-05-14 21:26:54 +00:00
Removed the excessive connecting and closing of the MongoDb databases
This commit is contained in:
@@ -14,8 +14,7 @@ for (i in categoriesJSON) {
|
||||
|
||||
function changeDB(bot, message, m) {
|
||||
try {
|
||||
const client = new MongoClient(bot.mongouri, { useNewUrlParser: true, useUnifiedTopology: true, serverApi: ServerApiVersion.v1 });
|
||||
client.connect(err => {
|
||||
bot.mongoconnection.then(client => {
|
||||
const dbo = client.db(message.guild.id).collection('trivia');
|
||||
//Game Over
|
||||
if (m == null) {
|
||||
|
||||
Reference in New Issue
Block a user