From d8506b7d21a02a773ceedb6d845e2d01dbe8f8d6 Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Fri, 14 Apr 2023 21:05:55 +1000 Subject: [PATCH] Fix any issues that rose upon. --- botStartup.bat | 2 +- src/client.ts | 2 +- src/commands/dev.ts | 2 +- src/commands/mp.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/botStartup.bat b/botStartup.bat index abc8b20..0d5edc2 100644 --- a/botStartup.bat +++ b/botStartup.bat @@ -1,2 +1,2 @@ @echo off -pm2 start src/index.ts --name Daggerbot -i 1 \ No newline at end of file +pm2 start dist/index.js --name Daggerbot \ No newline at end of file diff --git a/src/client.ts b/src/client.ts index 8320a15..f557f6e 100644 --- a/src/client.ts +++ b/src/client.ts @@ -101,7 +101,7 @@ export default class TClient extends Client { 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')}) - await this.login(this.tokens.beta); + await this.login(this.tokens.main); fs.readdirSync('dist/events').forEach(async file=>{ const eventFile = await import(`./events/${file}`); this.on(file.replace('.js', ''), async(...args)=>eventFile.default.run(this,...args)); diff --git a/src/commands/dev.ts b/src/commands/dev.ts index 4c19e2f..4dc60fe 100644 --- a/src/commands/dev.ts +++ b/src/commands/dev.ts @@ -67,7 +67,7 @@ export default { exec('git pull',(err:Error,stdout)=>{ if (err) clarkson.edit(`\`\`\`${removeUsername(err.message)}\`\`\``) else if (stdout.includes('Already up to date')) clarkson.edit('Bot is already up to date with the repository, did you forgor to push the changes? :skull:') - else setTimeout(()=>clarkson.edit(`Commit: **${fetchCommitMsg}**\nCommit author: **${fetchCommitAuthor}**\n\nUptime before restarting: **${client.formatTime(client.uptime as number, 3, {commas: true, longNames: true})}**`).then(()=>exec('pm2 restart Daggerbot')),650) + else setTimeout(()=>clarkson.edit(`Commit: **${fetchCommitMsg}**\nCommit author: **${fetchCommitAuthor}**\n\nUptime before restarting: **${client.formatTime(client.uptime as number, 3, {commas: true, longNames: true})}**`).then(()=>exec('tsc && pm2 restart Daggerbot')),650) }); }, presence: ()=>{ diff --git a/src/commands/mp.ts b/src/commands/mp.ts index 21dad43..2f4229b 100644 --- a/src/commands/mp.ts +++ b/src/commands/mp.ts @@ -99,7 +99,7 @@ export default { }, players: async()=>{ const embed1 = new client.embed(); - const data = JSON.parse(fs.readFileSync(path.join(__dirname, '../database/MPPlayerData.json'), {encoding: 'utf8'})).slice(client.statsGraph) + const data = JSON.parse(fs.readFileSync(path.join('src/database/MPPlayerData.json'), {encoding: 'utf8'})).slice(client.statsGraph) // handle negative days data.forEach((change: number, i: number) => { if (change < 0) data[i] = data[i - 1] || data[i + 1] || 0;