Discord embed webhook sending HTTP 400s

I’ve got this script, of course with my webhook link above, and I’m wondering how I would format this correctly, as I’ve looked over the dev forum and tried some other solutions with no fix.

local content = {
				["content"] = "",
				["embeds"] = {{
					["title"] = plr.Name.." | "..plr.UserId,
					["description"] = "Mod Call!",
					["color"] = tonumber(0x36393e),
					["fields"] = {
						{
						["name"] = "",
						["value"] = reasonfiltered,
						["inline"] = true
						},
					}
				}}
			}
			local ready = https:JSONEncode(content)
			https:PostAsync(webhook,ready)

First post, let me know if I’m doing something wrong because I’m known for being an idiot sometimes

have you looked at this?

i think the data you are sending to discord is confusing the bot

local Data = {
			["username"] = player.Name,
			["content"] = ":small_orange_diamond: joined server " ..Id
		}
		Data = http:JSONEncode(Data)
		http:PostAsync(Webhooks[Id], Data)

“I’m known for being an idiot sometimes” ← something we have in commen XD

That would work and all, but that’s not an embed. I’m looking to have an embed with the info I need it to send to make it prettier :sparkles: :sparkles:

Go to

Game Settings > Security > enable the Allow Http Request

Your “content” entry cannot be an empty message.

image
image

I should probably at least recommend that if you’re intending on embedding (using embeds = [ ] ), a content parameter isn’t required any further.

Secondly, you cannot have an empty “name” parameter in a field entry. I recommend using a Discord Webhook Generator and modeling your code off of that if you use HttpService’s JSONDecode function.

Hi. I have tested your code and finds out that you shouldn’t leave the ["name"] value inside the ["fields"] blank.

Here’s the example:

local content = {
		["content"] = "",
		["embeds"] = {{
			["title"] = Player.Name.." | "..Player.UserId,
			["description"] = "Mod Call!",
			["color"] = tonumber(0x36393e),
			["fields"] = {
				{
					["name"] = "Name",
					["value"] = "Value",
					["inline"] = true
				}
			}
		}}
	}

Tried it out and it worked perfect, thanks!