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

Discord Webhook HTTP 400 (Bad Request)?

Asked by 3 years ago

So im trying to make it when you start a application proccess it sends me a message into a discord. But its giving me a

HTTP 400 (Bad Request) - Server - Script:15

This is the script:

local http = game:GetService("HttpService")
local event = game.ReplicatedStorage.RemoteEvent

event.OnServerEvent:Connect(function(player, squad)
    print("Fired!")
    if squad == "CIS" then
        local data = 
            {
                ["title"] = "CIS Application started!",
                ["description"] = "Player: "..player.Name,
                ["color"] = 5158332,
                ["thumbnail"] = {url = game.Players:GetUserThumbnailAsync(player.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)}
            }
        local Data = http:JSONEncode(data)
        http:PostAsync("https://discord.com/api/webhooks/.../...", Data) -- Error Line
    end
end)
0
Are you sure the webhook URL is correct? lsltReaIIyYou 64 — 3y
0
Yes I copy and pasted it multipal times Ems_Squad 58 — 3y
0
Maybe the HTTP service is down for right now? Rayguyban2 89 — 3y
0
Make sure you're not making frequent requests. Ziffixture 6913 — 3y

2 answers

Log in to vote
2
Answered by
pwx 1581 Moderation Voter
3 years ago

Rather than discord.com, try http://discord.osyr.is

Reason is because I believe Discord blocked http requests with discord.com since when it first was used by developers, discord got fed up with the request strain from so many requests (or something like that, I didn't really read up on it too much).

Anyway, get back to me if it still doesn't work I'll see what I can do.

0
That gives "HttpError: DnsResolve" Ems_Squad 58 — 3y
Ad
Log in to vote
0
Answered by
Komas19 34
3 years ago

Make sure that you enabled HTTP requests

to enable it go to Home -> Game Settings -> Security -> Allow HTTP Request

0
I have. It was working before. Ems_Squad 58 — 3y
0
if it's in a localscript, try putting it in a normal script Komas19 34 — 3y

Answer this question