1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-12-28 13:05:38 -05:00

Update MongoDB config

This commit is contained in:
toast-ts 2023-05-16 11:21:25 +10:00
parent ece9f2775b
commit 28e8124919

View File

@ -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))