Update discord.lua

This commit is contained in:
Andyyy7666
2022-02-26 16:42:25 +01:00
committed by GitHub
parent 2788bedc13
commit 6f0fd87219

View File

@@ -14,8 +14,10 @@ function DiscordRequest(method, endpoint, jsondata)
return data
end
function IsRolePresent(user, role, theTable)
function IsRolePresent(user, role, theTable, type)
local discordId = nil
local theRole = nil
for _, id in ipairs(GetPlayerIdentifiers(user)) do
if string.match(id, "discord:") then
discordId = string.gsub(id, "discord:", "")
@@ -24,9 +26,8 @@ function IsRolePresent(user, role, theTable)
end
end
local theRole = nil
if type(role) == "number" then
theRole = tostring(role)
if type == "start" then
theRole = theTable
else
theRole = theTable[role]
end