mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 04:10:59 -05:00
Compare commits
4 Commits
611fa5867b
...
aa8278ac80
Author | SHA1 | Date | |
---|---|---|---|
|
aa8278ac80 | ||
|
010d9ab77d | ||
|
f517708ec3 | ||
|
708184d1a1 |
@ -50,7 +50,7 @@ export default {
|
|||||||
const SummonAuthentication = createTokenAuth(client.tokens.octokit);
|
const SummonAuthentication = createTokenAuth(client.tokens.octokit);
|
||||||
const {token} = await SummonAuthentication();
|
const {token} = await SummonAuthentication();
|
||||||
var githubRepo = {owner: 'AnxietyisReal', repo: 'Daggerbot-TS', ref: 'HEAD'};
|
var githubRepo = {owner: 'AnxietyisReal', repo: 'Daggerbot-TS', ref: 'HEAD'};
|
||||||
const clarkson = await interaction.reply({content: 'Pulling from repository...', fetchReply: true});
|
const hammond = await interaction.reply({content: 'Pulling from repository...', fetchReply: true});
|
||||||
const octokit = new Octokit({auth: token, timeZone: 'Australia/NSW', userAgent: 'Daggerbot-TS'});
|
const octokit = new Octokit({auth: token, timeZone: 'Australia/NSW', userAgent: 'Daggerbot-TS'});
|
||||||
const github = {
|
const github = {
|
||||||
fetchCommit: {
|
fetchCommit: {
|
||||||
@ -65,12 +65,12 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
exec('git pull',{windowsHide:true},(err:Error,stdout)=>{
|
exec('git pull',{windowsHide:true},(err:Error,stdout)=>{
|
||||||
if (err) clarkson.edit(`\`\`\`${UsernameHelper.stripName(err.message)}\`\`\``)
|
if (err) hammond.edit(`\`\`\`${UsernameHelper.stripName(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')) hammond.edit('I am already up to date with the upstream repository.')
|
||||||
else clarkson.edit('Compiling TypeScript files...').then(()=>exec('yarn tsc', {windowsHide:true}, (err:Error)=>{
|
else hammond.edit('Compiling TypeScript files...').then(()=>exec('yarn tsc', {windowsHide:true}, (err:Error)=>{
|
||||||
if (err) clarkson.edit(`\`\`\`${UsernameHelper.stripName(err.message)}\`\`\``)
|
if (err) hammond.edit(`\`\`\`${UsernameHelper.stripName(err.message)}\`\`\``)
|
||||||
if (interaction.options.getBoolean('restart')) 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: **${FormatTime(client.uptime, 3, {commas: true, longNames: true})}**`).then(()=>exec('pm2 restart Daggerbot', {windowsHide:true}));
|
if (interaction.options.getBoolean('restart')) hammond.edit(`[Commit:](<${github.fetchCommit.url}>) **${github.fetchCommit.msg.length === 0 ? 'No commit message' : 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: **${FormatTime(client.uptime, 3, {commas: true, longNames: true})}**`).then(()=>exec('pm2 restart Daggerbot', {windowsHide:true}));
|
||||||
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!`)
|
else hammond.edit(`[Commit:](<${github.fetchCommit.url}>) **${github.fetchCommit.msg.length === 0 ? 'No commit message' : 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!`)
|
||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -15,5 +15,5 @@
|
|||||||
"typeRoots": [ "./src/typings" ]
|
"typeRoots": [ "./src/typings" ]
|
||||||
},
|
},
|
||||||
"include": [ "src/" ],
|
"include": [ "src/" ],
|
||||||
"exclude": [ ".yarn/cache", ".yarn/unplugged", ".git", "src/config.json", "src/DB-Beta.config.json", "src/Toast-Testbot.config.json" ]
|
"exclude": [ ".yarn/cache", ".yarn/unplugged", ".git", "src/errorBlocklist.json", "src/config.json", "src/DB-Beta.config.json", "src/Toast-Testbot.config.json" ]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user