Hello, I made an admin panel that is refusing to allow me to log it to discord. It has worked on other places but now I am getting a “HTTP 403 Forbidden” error…
This is the necessary code:
Commands.Ban = function(Username, Staff, Reason)
Commands:Log(Staff, Username, "Ban", tostring(Reason))
BanStore:SetAsync(game.Players:GetUserIdFromNameAsync(Username), true)
end
function Commands:Log(Staff, Player, Type, Reason, Quantity)
if Type == "Ban" then
local pfpLink = "https://www.roblox.com/headshot-thumbnail/image?userId="..game.Players:GetUserIdFromNameAsync(Player).."&width=48&height=48&format=png"
local pfpLink2 = "https://www.roblox.com/headshot-thumbnail/image?userId="..game.Players:GetUserIdFromNameAsync(Staff.Name).."&width=100&height=100&format=png"
local Data = {
["content"] = "",
["embeds"] = {{
["author"] = {
["name"] = "Player was banned by "..Staff.Name,
["icon_url"] = pfpLink,
["url"] = ""
},
["description"] = "**Banned on:** ["..game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId).Name .. "](https://www.roblox.com/games/" .. game.PlaceId .. ")",
["color"] = 0xca7600,
["thumbnail"] = {
["url"] = pfpLink2
},
["fields"] = {
{
["name"] = "**__Player__**",
["value"] = "["..Player.."](https://www.roblox.com/users/"..game.Players:GetUserIdFromNameAsync(Player).."/profile)",
["inline"] = true
};
{
["name"] = "**__Staff__**",
["value"] = "["..Staff.Name.."](https://www.roblox.com/users/"..Staff.UserId.."/profile)",
["inline"] = true
};
{
["name"] = "**__Reason__**",
["value"] = Reason,
["inline"] = true
};
{
["name"] = "**__Evidence__**",
["value"] = "Attached below by Staff",
["inline"] = true
};
["footer"] = {
["text"] = DateTime.now():FormatUniversalTime("LL", "en-us")
}
}}
}}
local newdata = HttpService:JSONEncode(Data)
HttpService:PostAsync(BanUrl, newdata)
else
local pfpLink = "https://www.roblox.com/headshot-thumbnail/image?userId="..game.Players:GetUserIdFromNameAsync(Player.Name).."&width=48&height=48&format=png"
local pfpLink2 = "https://www.roblox.com/headshot-thumbnail/image?userId="..game.Players:GetUserIdFromNameAsync(Staff.Name).."&width=100&height=100&format=png"
local Data = {
["content"] = "",
["embeds"] = {{
["author"] = {
["name"] = "Player was warned by "..Staff.Name,
["icon_url"] = pfpLink,
["url"] = ""
},
["description"] = "**Warned on:** ["..game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId).Name .. "](https://www.roblox.com/games/" .. game.PlaceId .. ")",
["color"] = 0xca7600,
["thumbnail"] = {
["url"] = pfpLink2
},
["fields"] = {
{
["name"] = "**__Player__**",
["value"] = "["..Player.Name.."](https://www.roblox.com/users/"..game.Players:GetUserIdFromNameAsync(Player.Name).."/profile)",
["inline"] = true
};
{
["name"] = "**__Staff__**",
["value"] = "["..Staff.Name.."](https://www.roblox.com/users/"..Staff.UserId.."/profile)",
["inline"] = true
};
{
["name"] = "**__Reason__**",
["value"] = Reason,
["inline"] = true
};
{
["name"] = "**__Number of Warnings__**",
["value"] = Quantity,
["inline"] = true
};
["footer"] = {
["text"] = DateTime.now():FormatUniversalTime("LL", "en-us")
}
}}
}}
local newdata = HttpService:JSONEncode(Data)
HttpService:PostAsync(WarnUrl, newdata)
end
end
Commands.Warn = function(Player, Staff, Reason, Quantity)
local Player = game.Players[Player]
print(Staff, Player, "Warn", tostring(Reason), tostring(Quantity))
Commands:Log(Staff, Player, "Warn", tostring(Reason), tostring(Quantity))
local WarnText = Player.PlayerGui.AdminPanel.Warning.Text
local WarnThingy = Player.PlayerGui.AdminPanel.Warning
WarnThingy.Visible = true
WarnText = "You have been warned by "..Staff.Name.."\nReason: "..Reason.."\nWarning Number: "..Quantity
wait(5)
WarnThingy.Visible = false
end
Thank you for help