Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Discord Webhook HTTP 400 (Bad Request)?

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)

4 comments

0

Are you sure the webhook URL is correct?

0

Yes I copy and pasted it multipal times

0

Maybe the HTTP service is down for right now?

0

Make sure you're not making frequent requests.

2 answers

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.

1 comment

0

That gives "HttpError: DnsResolve"

Make sure that you enabled HTTP requests

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

2 comments

0

I have. It was working before.

0

if it's in a localscript, try putting it in a normal script

This discussion is preserved as it was. New answers, comments, and votes are closed.