Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Very confused: HTTP 400 (Bad Request) with webhook? line 27?

Asked by 3 years ago

I am trying to send report data to a webhook but get the HTTP 400 error. I do not know how to fix.

game.ReplicatedStorage.zndnsuwu.OnServerEvent:Connect(function(plr)
    local url = "https://discord.com/api/webhooks/xxxxxxxxxxxxxxxxxxxxxxx"
    local http = game:GetService("HttpService")

    local msg = {
        ["embeds"] = {{
            ["title"] = plr.Name.." has said",
            ["description"] = plr["PlayerGui"].reportSys.situationDescribed.Value,
            ["color"] = 5814783,
            ["fields"] = {
                    {
                ["name"] = "Evidence Provided",
                ["value"] = plr["PlayerGui"].reportSys.additionalEvidence.Value,
                }
            },
            ["author"]  = {
                {
                ["name"] = plr.Name.." has made a report against a player known as ".. plr["PlayerGui"].reportSys.playerReported.Value,
                ["icon_url"] = "https://tr.rbxcdn.com/9cca3cb4828966762e5173ab300e20c8/150/150/AvatarHeadshot/Png"
                }
            },


        }}
    }
    local finaldata = http:JSONEncode(msg)
    http:PostAsync(url,finaldata)
end)

Answer this question