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

Update dev.ts

This commit is contained in:
toast-ts 2023-08-09 10:12:04 +10:00 committed by GitHub
parent 53b10c3cd9
commit 791f00cab3

View File

@ -78,7 +78,7 @@ export default {
exec('git pull',(err:Error,stdout)=>{ exec('git pull',(err:Error,stdout)=>{
if (err) clarkson.edit(`\`\`\`${removeUsername(err.message)}\`\`\``) if (err) clarkson.edit(`\`\`\`${removeUsername(err.message)}\`\`\``)
else if (stdout.includes('Already up to date')) clarkson.edit('I am already up to date with the upstream repository.') else if (stdout.includes('Already up to date')) clarkson.edit('I am already up to date with the upstream repository.')
else clarkson.edit('Compiling TypeScript files...').then(()=>exec('tsc', (err:Error)=>{ else clarkson.edit('Compiling TypeScript files...').then(()=>exec('yarn tsc', (err:Error)=>{
if (err) clarkson.edit(`\`\`\`${removeUsername(err.message)}\`\`\``) if (err) clarkson.edit(`\`\`\`${removeUsername(err.message)}\`\`\``)
else clarkson.edit(`[Commit:](<${github.fetchCommit.url}>) **${github.fetchCommit.msg}**\nCommit author: **${github.fetchCommit.author}**\n\n__Commit changes__\nTotal: **${github.fetchChanges.total}**\nAdditions: **${github.fetchChanges.addition}**\nDeletions: **${github.fetchChanges.deletion}**\n\nSuccessfully compiled TypeScript files into JavaScript!\nUptime before restarting: **${client.formatTime(client.uptime as number, 3, {commas: true, longNames: true})}**`).then(()=>exec('pm2 restart Daggerbot')) else clarkson.edit(`[Commit:](<${github.fetchCommit.url}>) **${github.fetchCommit.msg}**\nCommit author: **${github.fetchCommit.author}**\n\n__Commit changes__\nTotal: **${github.fetchChanges.total}**\nAdditions: **${github.fetchChanges.addition}**\nDeletions: **${github.fetchChanges.deletion}**\n\nSuccessfully compiled TypeScript files into JavaScript!\nUptime before restarting: **${client.formatTime(client.uptime as number, 3, {commas: true, longNames: true})}**`).then(()=>exec('pm2 restart Daggerbot'))
})) }))
@ -122,7 +122,7 @@ export default {
}, },
restart: async()=>{ restart: async()=>{
const i = await interaction.reply({content: 'Compiling TypeScript files...', fetchReply: true}); const i = await interaction.reply({content: 'Compiling TypeScript files...', fetchReply: true});
exec('tsc',(err:Error)=>{ exec('yarn tsc',(err:Error)=>{
if (err) i.edit(`\`\`\`${removeUsername(err.message)}\`\`\``) if (err) i.edit(`\`\`\`${removeUsername(err.message)}\`\`\``)
else i.edit(`Successfully compiled TypeScript files into JavaScript!\nUptime before restarting: **${client.formatTime(client.uptime as number, 3, {commas: true, longNames: true})}**`).then(()=>exec('pm2 restart Daggerbot')) else i.edit(`Successfully compiled TypeScript files into JavaScript!\nUptime before restarting: **${client.formatTime(client.uptime as number, 3, {commas: true, longNames: true})}**`).then(()=>exec('pm2 restart Daggerbot'))
}) })