mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-18 14:26:03 +01:00
fix: bot token check
This commit is contained in:
@@ -57,6 +57,7 @@ function NDCore.loadSQL(fileLocation, resource)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function NDCore.getDiscordInfo(discordUserId)
|
function NDCore.getDiscordInfo(discordUserId)
|
||||||
|
if not discordUserId or not Config.discordBotToken or not Config.discordGuildId then return end
|
||||||
local done = false
|
local done = false
|
||||||
local data
|
local data
|
||||||
local discordErrors = {
|
local discordErrors = {
|
||||||
@@ -66,7 +67,6 @@ function NDCore.getDiscordInfo(discordUserId)
|
|||||||
[429] = "Discord bot rate limited"
|
[429] = "Discord bot rate limited"
|
||||||
}
|
}
|
||||||
|
|
||||||
if not discordUserId then return end
|
|
||||||
if type(discordUserId) == "string" and discordUserId:find("discord:") then discordUserId:gsub("discord:", "") end
|
if type(discordUserId) == "string" and discordUserId:find("discord:") then discordUserId:gsub("discord:", "") end
|
||||||
|
|
||||||
PerformHttpRequest(("https://discordapp.com/api/guilds/%s/members/%s"):format(Config.discordGuildId, discordUserId), function(errorCode, resultData, resultHeaders)
|
PerformHttpRequest(("https://discordapp.com/api/guilds/%s/members/%s"):format(Config.discordGuildId, discordUserId), function(errorCode, resultData, resultHeaders)
|
||||||
|
|||||||
Reference in New Issue
Block a user