tweak: handle new DC username in playerlist

This commit is contained in:
Jacob
2024-09-02 02:37:49 +01:00
parent 0e52d6a63a
commit db7a5750d8
+12 -2
View File
@@ -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