attempt to query database before loading bot

This commit is contained in:
JandereDev 2021-12-05 15:16:41 +01:00
parent 9940d21e42
commit 1ec1b927fb
No known key found for this signature in database
GPG key ID: 5D5E18ACB990F57A

View file

@ -12,6 +12,13 @@ login(client);
export { client }
// Load modules
import('./bot/modules/command_handler');
import('./bot/modules/mod_logs');
(async () => {
// Wait for a database query to succeed before loading the rest
logger.info('Connecting to database...');
await db.get('servers').findOne({});
logger.done('DB ready!');
// Load modules
import('./bot/modules/command_handler');
import('./bot/modules/mod_logs');
})();