From 6f0fd872193362a304257ee834d04a968fdf8b1f Mon Sep 17 00:00:00 2001 From: Andyyy7666 <86536434+Andyyy7666@users.noreply.github.com> Date: Sat, 26 Feb 2022 16:42:25 +0100 Subject: [PATCH] Update discord.lua --- ND_Core/source/server/discord.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ND_Core/source/server/discord.lua b/ND_Core/source/server/discord.lua index d893d45..6028908 100644 --- a/ND_Core/source/server/discord.lua +++ b/ND_Core/source/server/discord.lua @@ -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