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

Provide Axios status when host is unreachable.

This commit is contained in:
toast-ts 2023-02-03 04:27:39 +11:00
parent bfba4fb4d2
commit e78f4bb3fb
2 changed files with 3 additions and 1 deletions

View File

@ -82,7 +82,7 @@ export default class TClient extends Client {
} }
async init(){ async init(){
MPDB.sync(); MPDB.sync();
this.login(this.tokens.token_main); this.login(this.tokens.token_beta);
this.punishments.initLoad(); this.punishments.initLoad();
this.bannedWords.initLoad(); this.bannedWords.initLoad();
this.bonkCount.initLoad(); this.bonkCount.initLoad();

View File

@ -85,6 +85,7 @@ setInterval(async()=>{
await Promise.all([serverData(client, completedURL_DSS), serverData(client, completedURL_CSG)]).then(function(results){ await Promise.all([serverData(client, completedURL_DSS), serverData(client, completedURL_CSG)]).then(function(results){
if (typeof results[0] == 'string'){ if (typeof results[0] == 'string'){
FSdss.fetchResult = `dag mp dss fail, ${results[0]}`; FSdss.fetchResult = `dag mp dss fail, ${results[0]}`;
embed.addFields({name: 'DSS Status', value: results[0]})
} else if (results[0].status != 200){ } else if (results[0].status != 200){
FSdss.fetchResult = `dag mp dss fail with ${results[0].status + ' ' + results[0].statusText}`; FSdss.fetchResult = `dag mp dss fail with ${results[0].status + ' ' + results[0].statusText}`;
} else { } else {
@ -92,6 +93,7 @@ setInterval(async()=>{
} }
if (typeof results[1] == 'string'){ if (typeof results[1] == 'string'){
FScsg.fetchResult = `dag mp csg fail, ${results[1]}`; FScsg.fetchResult = `dag mp csg fail, ${results[1]}`;
embed.addFields({name: 'CSG Status', value: results[1]})
} else if (results[1].status != 200){ } else if (results[1].status != 200){
if (results[1].status == 204){embed.setImage('https://http.cat/204')} if (results[1].status == 204){embed.setImage('https://http.cat/204')}
FScsg.fetchResult = `dag mp csg fail with ${results[1].status + ' ' + results[1].statusText}`; FScsg.fetchResult = `dag mp csg fail with ${results[1].status + ' ' + results[1].statusText}`;