1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 00:10:58 -05:00

Compare commits

..

2 Commits

Author SHA1 Message Date
AnxietyisReal
f59295d15a Update startWithYarn.cjs 2023-08-13 17:29:07 +10:00
AnxietyisReal
6dbaeda7d6 it didnt work.. 2023-08-13 17:16:39 +10:00
2 changed files with 4 additions and 7 deletions

View File

@ -33,7 +33,7 @@ function DZ(error:Error, type:string){// Yes, I may have shiternet but I don't n
if ([ if ([
'getaddrinfo ENOTFOUND discord.com', 'getaddrinfo EAI_AGAIN discord.com', 'getaddrinfo ENOTFOUND discord.com', 'getaddrinfo EAI_AGAIN discord.com',
'[Error: 30130000:error:0A000410:SSL', '[Error: F8200000:error:0A000410:SSL', '[Error: 30130000:error:0A000410:SSL', '[Error: F8200000:error:0A000410:SSL',
'HTTPError: Internal Server Error', 'ExperimentalWarning: ' 'HTTPError: Internal Server Error'
].includes(error.message)) return; ].includes(error.message)) return;
console.error(error); console.error(error);
(client.channels.resolve(client.config.mainServer.channels.errors) as Discord.TextChannel | null)?.send({embeds: [new client.embed().setColor('#560000').setTitle('Error caught!').setFooter({text: 'Error type: ' + type}).setDescription(`**Error:**\n\`\`\`${error.message}\`\`\`**Stack:**\n\`\`\`${`${error.stack}`.slice(0, 2500)}\`\`\``)]}) (client.channels.resolve(client.config.mainServer.channels.errors) as Discord.TextChannel | null)?.send({embeds: [new client.embed().setColor('#560000').setTitle('Error caught!').setFooter({text: 'Error type: ' + type}).setDescription(`**Error:**\n\`\`\`${error.message}\`\`\`**Stack:**\n\`\`\`${`${error.stack}`.slice(0, 2500)}\`\`\``)]})
@ -41,7 +41,6 @@ function DZ(error:Error, type:string){// Yes, I may have shiternet but I don't n
process.on('unhandledRejection', (error: Error)=>DZ(error, 'unhandledRejection')); process.on('unhandledRejection', (error: Error)=>DZ(error, 'unhandledRejection'));
process.on('uncaughtException', (error: Error)=>DZ(error, 'uncaughtException')); process.on('uncaughtException', (error: Error)=>DZ(error, 'uncaughtException'));
process.on('error', (error: Error)=>DZ(error, 'nodeError')); process.on('error', (error: Error)=>DZ(error, 'nodeError'));
process.on('warning', (warn: Error)=>DZ(warn, 'nodeWarning'));
client.on('error', (error: Error)=>DZ(error, 'client-error')); client.on('error', (error: Error)=>DZ(error, 'client-error'));
// Audio Player event handling // Audio Player event handling
@ -92,9 +91,7 @@ setInterval(async()=>{
dailyMsgs.push([formattedDate, total]); dailyMsgs.push([formattedDate, total]);
writeFileSync('./src/database/dailyMsgs.json', JSON.stringify(dailyMsgs)) writeFileSync('./src/database/dailyMsgs.json', JSON.stringify(dailyMsgs))
console.log(client.logTime(), `Pushed [${formattedDate}, ${total}] to dailyMsgs`); console.log(client.logTime(), `Pushed [${formattedDate}, ${total}] to dailyMsgs`);
if (client.token != client.tokens.main){ client.guilds.cache.get(client.config.mainServer.id).commands.fetch().then(commands=>(client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel).send(`:pencil: Pushed \`[${formattedDate}, ${total}]\` to </rank leaderboard:${commands.find(x=>x.name === 'rank').id}>`));
client.guilds.cache.get(client.config.mainServer.id).commands.fetch().then(commands=>(client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel).send(`:pencil: Pushed \`[${formattedDate}, ${total}]\` to </rank leaderboard:${commands.find(x=>x.name === 'rank').id}>`)); (client.channels.resolve(client.config.mainServer.channels.thismeanswar) as Discord.TextChannel).send({files:['./src/database/dailyMsgs.json']}).catch(fileErr=>console.log(fileErr))
(client.channels.resolve(client.config.mainServer.channels.thismeanswar) as Discord.TextChannel).send({files:['./src/database/dailyMsgs.json']}).catch(fileErr=>console.log(fileErr))
} else console.log(client.logTime(), 'Development bot\'s token is in use, not uploading dailyMsgs.json to channel.')
} }
}, 5000) }, 5000)

View File

@ -1 +1 @@
require('node:child_process').spawn('yarn node dist/index.js', {stdio: [null,process.stdout,process.stderr,null], windowsHide: true, shell: true}) require('node:child_process').spawn('yarn && yarn node dist/index.js', {stdio: [null,process.stdout,process.stderr,null], windowsHide: true, shell: true})