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

Hotfix for no log whenever the "Server didn't respond" embed appears

This commit is contained in:
toast-ts 2024-01-06 23:46:21 +11:00
parent cb5d0e31f7
commit e3a55e6210

View File

@ -21,7 +21,10 @@ export default async(client:TClient)=>{
async function newServerEntry(server:IServer) { async function newServerEntry(server:IServer) {
const serverData = await requestServerData(client, server); const serverData = await requestServerData(client, server);
if (!serverData) return new client.embed().setColor(client.config.embedColorRed).setTitle('Server didn\'t respond').setFooter({text: 'Last updated'}).setTimestamp(); if (!serverData) {
Logger.console('log', loggingPrefix, `${server.serverName} seems to be unavailable to take requests at this time`)
return new client.embed().setColor(client.config.embedColorRed).setTitle('Server didn\'t respond').setFooter({text: 'Last updated'}).setTimestamp();
};
const {dss, csg} = serverData; const {dss, csg} = serverData;
if (dss === null ?? csg === null ?? !dss ?? !csg ?? !dss.slots ?? !csg.slotSystem) return new client.embed().setColor(client.config.embedColorRed).setTitle(`${server.serverName} did not respond`).setFooter({text: 'Last updated'}).setTimestamp(); if (dss === null ?? csg === null ?? !dss ?? !csg ?? !dss.slots ?? !csg.slotSystem) return new client.embed().setColor(client.config.embedColorRed).setTitle(`${server.serverName} did not respond`).setFooter({text: 'Last updated'}).setTimestamp();
// Skip the server if the parts of the data is missing. // Skip the server if the parts of the data is missing.
@ -85,7 +88,7 @@ export default async(client:TClient)=>{
let hookId = isBotInDevMode ? '1098524887557099520' : '1159998634604109897'; let hookId = isBotInDevMode ? '1098524887557099520' : '1159998634604109897';
let msgId = isBotInDevMode ? '1159855742535352462' : '1160098458997370941'; let msgId = isBotInDevMode ? '1159855742535352462' : '1160098458997370941';
const mfServer = cachedServers.find(s=>s.ip.split(':')[1] === '18001' && s.isActive); const mfServer = cachedServers.find(s=>s.ip.split(':')[1] === '18001' && s.isActive);
if (mfServer) multifarmWebhook(client, mfServer, hookId, msgId); if (mfServer && mfServer.isActive) multifarmWebhook(client, mfServer, hookId, msgId);
} }
async function multifarmWebhook(client:TClient, server:IServer, webhookId:string, messageId:string) { async function multifarmWebhook(client:TClient, server:IServer, webhookId:string, messageId:string) {