From 12c2714ccf159877ec7c6e2cff27cd9560233f94 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Wed, 10 Jan 2024 09:45:30 +1100 Subject: [PATCH] Attempt to prevent MPModule from requesting the hidden server --- src/modules/MPModule.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/MPModule.ts b/src/modules/MPModule.ts index 6ff2398..20ba851 100644 --- a/src/modules/MPModule.ts +++ b/src/modules/MPModule.ts @@ -87,11 +87,13 @@ export default async(client:TClient)=>{ // Locate the Multifarm server via port and call the webhook with that server's details. (Adddi's server) let hookId = isBotInDevMode ? '1098524887557099520' : '1159998634604109897'; let msgId = isBotInDevMode ? '1159855742535352462' : '1160098458997370941'; - const mfServer = cachedServers.find(s=>s.ip.split(':')[1] === '18001' && s.isActive); - if (mfServer && mfServer.isActive) multifarmWebhook(client, mfServer, hookId, msgId); + const mfServer = cachedServers.filter(s=>s.isActive).find(s=>s.ip.split(':')[1] === '18001'); + if (mfServer) multifarmWebhook(client, mfServer, hookId, msgId); } async function multifarmWebhook(client:TClient, server:IServer, webhookId:string, messageId:string) { + if (!server.isActive) return; + const txtMapping = { genericBools: { 'false': 'Off', 'true': 'On' }, growthMode: { '1': 'Yes', '2': 'No', '3': 'Growth paused' },