diff --git a/mapinfo_stoat.js b/mapinfo_stoat.js index ac59605..a67270f 100644 --- a/mapinfo_stoat.js +++ b/mapinfo_stoat.js @@ -307,12 +307,12 @@ async function checkNewMessages(channel_selected, admin_chat_bool) { function sanitizeForRcon(str, maxLength = 200) { if (typeof str !== 'string') return ''; return str - .replace(/[^\w\s.,!?'\-]/g, '') // keep only safe chars, strip everything else + .replace(/[\r\n]+/g, ' ') // collapse newlines to a space first + .replace(/[^\w .,!?'\-]/g, '') // note: \s replaced with a literal space .trim() .slice(0, maxLength); } - var lastProcessedMessageId_rcon_ze = null; async function checkNewMessages_rcon_ze() { try {