How can I send an image to a discord webhook?

Before you flag this as duplicate and go, I wanted to tell you that I have used LITERALLY EVERYTHING I could find to send an image inside an embed.
Hey guys,
Today am scripting a discord webhook for the first time, and well am running into problems while trying to send an image to the embed. Here’s my code:

local HTTP = game:GetService("HttpService")
	local data = {
		["embeds"] = {{
			["avatar_url"] = {url = tostring(game.Players:GetUserThumbnailAsync(player.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420))},
			["description"] = "Player " .. player.Name .. " joined the game!",
			["color"] = tonumber(0xFFFAFA),
			["fields"] = {
					["name"] = "Account Age",
					["value"] = player.AccountAge.. " days",
					["inline"] = true
					["name"] = "User ID",
					["value"] = player.UserId,
					["inline"] = true

	local finaldata = HTTP:JSONEncode(data)
	HTTP:PostAsync("", finaldata)

2021-07-23 (2)
I also tried the “author” method to no avail. Please help me, thanks.

Not sure if you want to achieve the same, but after a quick search I found this post Sending Images with webhooks - #16 by DaCrazyDev Hope it helps.

1 Like

According to the Discord API you can attach an image and thumbnail to the embed.

1 Like
["thumbnail"] = {["url"] = "" .. player.UserId .. "&width=150&height=150&format=png"},

Is the correct field (I think) for getting the player’s PFP, you can use this & replace ["avatar_url"]


Used that too, no avail. Will check again tho

This won’t solve your question, but it’s worth mentioning something I said the other day which relates to this:


Ik that, I was just practicing, i wont dare to use it in a real game lol