How do you make a discord webhook send an embed message?

Well, I was wondering how you send embed messages. Sincerely, in the webhook, I get an error code saying HTTP 404 Take a look at this code I’ve made for every player who join the server

local HttpServ = game:GetService('HttpService')
local url = "https://discordapp.com/api/webhooks/***/****"

game.Players.PlayerAdded:Connect(function(plr)
	local data = {
		["type"] = "rich",
		["content"] = "Hi",
		["tts"] = false,
		["embed"] = {
			["title"] = "Hello",
			["description"] = "Hi"
		}
	}
	local newdata = HttpServ:JSONEncode(data)
	
	HttpServ:PostAsync(url, newdata)
end)
15 Likes

This is what I’m currently doing for embeds.

local data = 
	{
		["content"] = "",
		["embeds"] = {{
			["title"] = "__**Ultimate Title**__",
			["description"] = "blah blah",
			["type"] = "rich",
			["color"] = tonumber(0xffffff),
			["fields"] = {
				{
					["name"] = "__Title__",
					["value"] = "hi",
					["inline"] = true
				},
				{
					["name"] = "__Title__",
					["value"] = "hi",
					["inline"] = true
				}
			}
		}}
	}
66 Likes

Great! I tested it and it worked!

How would you add a footer? Would you just add [“footer”] = “hi this is a footer”, after the line with [“color”]?

["footer"] = {
  ["icon_url"] = "direct_link_to_img.png", -- optional
  ["text"] = "text"
}
2 Likes

Does the footer go in the embed part, or outside of it?

Worked it out: it goes inside the embed.

1 Like

How would I add an image to this?

1 Like

[“thumbnail”[ = {
url = DISCORD URL LINK HERE
}

3 Likes

How would you be able to send a HeadShot of the player in the embed thumbnail? It needs to be a link so using the :GetUserThumbnailAsync wouldn’t work.

1 Like

json data:

{
  ['embeds'] = {
    {
       ['title'] = 'hello world',
       ['description'] = 'description',
       ['fields'] = {
          {name = 'memers', value = 'nobody'},
          {name = 'farters', value = 'nobody'}
       }
    }
  }
}
3 Likes

A tad late but https://www.roblox.com/headshot-thumbnail/image?userId=USER_ID&width=420&height=420&format=png

1 Like

How would you ping a role via the embed?

if i remember right you can type like this <@(userid or roleid)>

Sorry, to add on here, currently to ping a role its: " <@& role id > "