Hello, I am trying to give a Discord role from the server using “PerformHttpRequest” but I am facing a 401 problem. Note: I removed the token for privacy only this code
local guildId = "1045364852975218808"
local userId = "911403094334660628"
local roleId = "1063145958621315182"
PerformHttpRequest("http://discord.com/api/guilds/" .. guildId .. "/members/" .. userId .. "/roles/" .. roleId, function (errorCode, resultData, resultHeaders, errorData)
if errorCode == 204 then
print("successfully")
else
print("eror " .. errorCode)
end
end, "PUT", "", {["Content-Type"] = "application/json",
["Authorization"] = "Bot **"
})