From d858e1174b439013f4d7229cafcf33617785313c Mon Sep 17 00:00:00 2001 From: Horyoshi <42314202+Cinecom@users.noreply.github.com> Date: Thu, 8 Jan 2026 19:58:13 +0100 Subject: [PATCH] Bug Fix --- matrix.lua | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/matrix.lua b/matrix.lua index 31e449b..b2137cf 100644 --- a/matrix.lua +++ b/matrix.lua @@ -689,16 +689,31 @@ function sepgp_matrix:AnnounceTeams() channel = "RAID_WARNING" end + -- Helper function to send names in chunks of 9 + local NAMES_PER_MESSAGE = 9 + local function sendTeamMessages(names, teamLabel, teamColor) + local totalNames = table.getn(names) + if totalNames == 0 then return end + + local chunk = {} + for i, name in ipairs(names) do + table.insert(chunk, name) + if table.getn(chunk) == NAMES_PER_MESSAGE or i == totalNames then + local msg = teamColor .. teamLabel .. "|r: " .. table.concat(chunk, ", ") + SendChatMessage(msg, channel) + chunk = {} + end + end + end + -- Red team announcement - local redMsg = "|cffff3333RED TEAM (Left)|r: " .. table.concat(redNames, ", ") - SendChatMessage(redMsg, channel) + sendTeamMessages(redNames, "RED TEAM (Left)", "|cffff3333") -- Empty line separator (send a simple divider) SendChatMessage("---", channel) -- Blue team announcement - local blueMsg = "|cff3366ffBLUE TEAM (Right)|r: " .. table.concat(blueNames, ", ") - SendChatMessage(blueMsg, channel) + sendTeamMessages(blueNames, "BLUE TEAM (Right)", "|cff3366ff") -- Also print locally sepgp:defaultPrint("Matrix teams have been announced!")