From 574145a18327e548a23a9dbd203194ea8a053fc2 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Wed, 27 Dec 2023 21:56:38 +1100 Subject: [PATCH] Fix destructure issue in MPModule's webhook --- src/modules/MPModule.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/MPModule.ts b/src/modules/MPModule.ts index 21e2d11..b3d79c6 100644 --- a/src/modules/MPModule.ts +++ b/src/modules/MPModule.ts @@ -112,8 +112,9 @@ async function multifarmWebhook(client:TClient, server:IServer, webhookId:string } }; const getMappedValue =(map:Record, key:string, fallback:T):T=>map[key] ?? fallback; - const {csg} = await requestServerData(client, server); - if (!csg) return Logger.console('log', loggingPrefix, 'Couldn\'t get data for webhook'); + const data = await requestServerData(client, server); + if (!data) return Logger.console('log', loggingPrefix, 'Couldn\'t get data for webhook'); + const {csg} = data;// :tutelBRUH: (https://cdn.discordapp.com/emojis/1155276126176956486.webp) const fields:Discord.APIEmbedField[] = [ {name: 'Seasonal Growth', value: getMappedValue(txtMapping.growthMode, csg?.settings.growthMode, dataUnavailable), inline: true}, {name: 'Crop Destruction', value: getMappedValue(txtMapping.genericBools, csg?.settings.fruitDestruction, dataUnavailable), inline: true},