HTTP 400 (Bad Request) (Discord WebHooks)

  1. What do you want to achieve?
    I want to send over data to my discord server.

  2. What is the issue?
    Sending the profile picture or fields causes the request to error.

  3. What solutions have you tried so far?
    I’ve tried looking around the devForums, but none of their solutions worked for me.

game:GetService("Players").PlayerAdded:Connect(function(plr)
	local data = {
		["embeds"] = {
			{
				["title"] = "Player Joined!",
				["description"] = plr.Name.." Joined The Game.",
				["color"] = 4062976,
				["url"] = "https://www.roblox.com/users/"..plr.UserId.."/profile",
				["thumbnail"] = "https://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&username="..plr.Name,
				["fields"] = {
					["name"] = "Account Age:",
					["value"] = plr.AccountAge,
					["inline"] = true
				}
			}
		}
	}
	
	local finalData = http:JSONEncode(data)
	http:PostAsync(url, finalData)
end)

Yeah, I gotta tell you something, Discord Webhooks are blocked on roblox.

1 Like

I recommend watching this video.
How to create a webhook with 1 LINE OF CODE | Roblox Studio - YouTube
It works and I use it for my game.

1 Like

But why are they sending requests to my server fine without fields or images?
image

Yeah, because its on Roblox Studio. It does not work on the proper game.

2 Likes

Oh alright, thanks for letting me know.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.