mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-19 14:56:02 +01:00
Update discord.lua
This commit is contained in:
@@ -14,8 +14,10 @@ function DiscordRequest(method, endpoint, jsondata)
|
|||||||
return data
|
return data
|
||||||
end
|
end
|
||||||
|
|
||||||
function IsRolePresent(user, role, theTable)
|
function IsRolePresent(user, role, theTable, type)
|
||||||
local discordId = nil
|
local discordId = nil
|
||||||
|
local theRole = nil
|
||||||
|
|
||||||
for _, id in ipairs(GetPlayerIdentifiers(user)) do
|
for _, id in ipairs(GetPlayerIdentifiers(user)) do
|
||||||
if string.match(id, "discord:") then
|
if string.match(id, "discord:") then
|
||||||
discordId = string.gsub(id, "discord:", "")
|
discordId = string.gsub(id, "discord:", "")
|
||||||
@@ -24,9 +26,8 @@ function IsRolePresent(user, role, theTable)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local theRole = nil
|
if type == "start" then
|
||||||
if type(role) == "number" then
|
theRole = theTable
|
||||||
theRole = tostring(role)
|
|
||||||
else
|
else
|
||||||
theRole = theTable[role]
|
theRole = theTable[role]
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user