From 4750e165a240acf1243fa0c19937fbcf559c2394 Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Thu, 12 Oct 2023 22:34:00 +1100 Subject: [PATCH] Backport the patch from Canary bot. --- src/funcs/MPModule.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/funcs/MPModule.ts b/src/funcs/MPModule.ts index f246ee4..2898b05 100644 --- a/src/funcs/MPModule.ts +++ b/src/funcs/MPModule.ts @@ -76,8 +76,8 @@ export default async(client:TClient, Channel:string, Message:string, Server:TSer } else { client.MPServerCache[ServerName].status = 'online'; const serverDetails = new client.embed().setColor(client.config.embedColor).setTitle('Server details').setFields( - {name: 'Current map', value: hitDSS.server.mapName, inline: true}, - {name: 'Server version', value: hitDSS.server.version, inline: true}, + {name: 'Current map', value: hitDSS?.server?.mapName === undefined ? dataUnavailable : hitDSS.server.mapName, inline: true}, + {name: 'Server version', value: hitDSS?.server?.version === undefined ? dataUnavailable : hitDSS.server.version, inline: true}, {name: 'In-game Time', value: `${('0'+Math.floor((hitDSS.server.dayTime/3600/1000))).slice(-2)}:${('0'+Math.floor((hitDSS.server.dayTime/60/1000)%60)).slice(-2)}`, inline: true}, {name: 'Slot Usage', value: isNaN(Number(hitCSG?.slotSystem?.slotUsage)) === true ? dataUnavailable : Number(hitCSG.slotSystem?.slotUsage).toLocaleString('en-us'), inline: true}, {name: 'Autosave Interval', value: isNaN(Number(hitCSG?.settings?.autoSaveInterval)) === true ? dataUnavailable : Number(hitCSG.settings?.autoSaveInterval).toFixed(0)+' mins', inline:true},