From f9bbef37e3b32bf83276a53c3358dd844f83851f Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Mon, 5 Apr 2021 14:37:11 -0500 Subject: [PATCH] Add async for querying mongoDB --- bot.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot.js b/bot.js index 3d1f7a8..7dbdd6b 100644 --- a/bot.js +++ b/bot.js @@ -115,7 +115,7 @@ async function aboutBot(message) { } async function memberCountChannelUpdate(member) { - collection.findOne({ guild_id: member.guild.id }, (error, result) => { + collection.findOne({ guild_id: member.guild.id }, async (error, result) => { if (error) { console.error; } @@ -256,7 +256,7 @@ async function memberCountChannelCreate(message) { message.reply("you do not have admin permissions!"); return; } - collection.findOne({ guild_id: message.guild.id }, (error, result) => { + collection.findOne({ guild_id: message.guild.id }, async (error, result) => { if (error) { console.error; }