tweak: handle new DC username in playerlist
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user