How can I use ["icon_url"] in a webhook script? [ CLOSED]

Everytime I try to use icon_url it never loads the icon in the web hook.
Heres my script

function webhook:CreateHook(HookUrl)
	local Embed = {
		["content"] = nil,
		["embeds"] = {{
		["icon_url"] = "https://pngimg.com/uploads/earth/earth_PNG21.png",
			["title"] = "Test",
			["description"] = "Test",
			["color"] = tonumber(0x48BE89),
			["footer"] = {
				["text"] = "Test"
			},
			["fields"] = {
				{
					["name"] = "Server Name:",
					["value"] = MarketPlaceService:GetProductInfo(game.PlaceId).Name
				},
				{
					["name"] = "Player Count:",
					["value"] = #Players:GetChildren()
				}
			}
		}}
	}
	local Result = HttpService:JSONEncode(Embed)
	HttpService:PostAsync(HookUrl, Result)
end;
return webhook

From what I remember the icon_url refers to the webhook, so take it out of the “embeds”.

Placing it below content doesnt make it pop up either

Oh, by referring to some documentation about Discord Webhooks, it seems it should be called avatar_url instead of icon_url. Try changing that, and of course placing it under “content” instead of inside your embed.

Discord Webhook - Discord Webhooks Guide (birdie0.github.io)

Still does not seem to work ([30chartestestest])

Are there any errors? I just tested this and it seems to work properly.

Turns out i forgot to use “author” I was talking about the “icon_url” which displays a icon in the embed
(Basically saying i fixed it)

1 Like