From 28e8124919e6ec48c44aabb6abe1ada3037cccb9 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Tue, 16 May 2023 11:21:25 +1000 Subject: [PATCH] Update MongoDB config --- src/client.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client.ts b/src/client.ts index 627e53a..c16ffc5 100644 --- a/src/client.ts +++ b/src/client.ts @@ -93,12 +93,14 @@ export default class TClient extends Client { await mongoose.connect(this.tokens.mongodb_uri, { replicaSet: 'toastyy', autoIndex: true, + authMechanism:'DEFAULT', + authSource: 'admin', serverSelectionTimeoutMS: 15000, waitQueueTimeoutMS: 50000, socketTimeoutMS: 30000, family: 4 }).then(()=>console.log(this.logTime(), 'Successfully connected to MongoDB')).catch(err=>{console.error(this.logTime(), `Failed to connect to MongoDB\n${err.reason}`); exec('pm2 stop Daggerbot')}) - this.login(this.tokens.main); + this.login(this.tokens.beta); for await (const file of fs.readdirSync('dist/events')){ const eventFile = await import(`./events/${file}`); this.on(file.replace('.js',''), async(...args)=>eventFile.default.run(this,...args))