From db7a5750d8b2566636eb27e5d8685194e883701e Mon Sep 17 00:00:00 2001 From: Jacob <42719082+ThatGuyJacobee@users.noreply.github.com> Date: Mon, 2 Sep 2024 02:37:49 +0100 Subject: [PATCH] tweak: handle new DC username in playerlist --- resources/EGRP-Playerlist/server.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/resources/EGRP-Playerlist/server.lua b/resources/EGRP-Playerlist/server.lua index 233c30fb6..0dabc0d62 100644 --- a/resources/EGRP-Playerlist/server.lua +++ b/resources/EGRP-Playerlist/server.lua @@ -26,7 +26,12 @@ AddEventHandler('Bad-ServerList:SetupImg', function() avatars[license] = Config.Default_Profile; end if (discordName ~= nil) then - discordNames[license] = discordName; + -- Custom adjustment to manage new Discord Username format + if (string.sub(discordName, -2) == "#0") then + discordNames[license] = string.sub(discordName, 1, -3); + else + discordNames[license] = discordName; + end else discordNames[license] = Config.Discord_Not_Found; end @@ -53,7 +58,12 @@ AddEventHandler('Bad-ServerList:SetupRestart', function(src) avatars[license] = Config.Default_Profile;; end if (discordName ~= nil) then - discordNames[license] = discordName; + -- Custom adjustment to manage new Discord Username format + if (string.sub(discordName, -2) == "#0") then + discordNames[license] = string.sub(discordName, 1, -3); + else + discordNames[license] = discordName; + end else discordNames[license] = Config.Discord_Not_Found; end