From ee6ab6ab721367df1f8076c75984a1e7842662e4 Mon Sep 17 00:00:00 2001 From: AreYouScared Date: Fri, 19 Jul 2019 06:05:03 -0400 Subject: [PATCH] Remove GPS pings in crosschat (#172) * Remove GPS pings in crosschat Cross-server gps pings are annoying, lets fix that * Lets just do it the right way <3 Should be better * Take 2 Let's try that again --- sharedPlugins/globalChat/index.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sharedPlugins/globalChat/index.js b/sharedPlugins/globalChat/index.js index 65fe7738..99622368 100644 --- a/sharedPlugins/globalChat/index.js +++ b/sharedPlugins/globalChat/index.js @@ -22,12 +22,15 @@ module.exports = class remoteCommands { words.shift(); words.shift(); words.shift(); - let message = words.join(" ").replace(/[";]/g, " ").replace(/[']/g,"").replace("/shout ", "").replace("!shout", ""); + let message = words.join(" ").replace(/[";]/g, " ").replace(/[']/g,"").replace("/shout ", "").replace("!shout ","").replace(/\[gps=.*?\]/g, "").replace(/\[train=.*?\]/g, ""); - let instance = await this.getInstanceName(data.instanceID); - - this.messageInterface("/silent-command game.print('[" + instance + "] " + message + "')"); - } + let instance = await this.getInstanceName(data.instanceID); + if(data.data.includes("[gps=")){ + //Nothing + }else{ + this.messageInterface("/silent-command game.print('[" + instance + "] " + message + "')"); + } + } } }); }