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")
game.Players.PlayerAdded:Connect(function(player)
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("https://discord.com/api/webhooks/MyWebhook", finaldata)
end)
Result:
I also tried the “author” method to no avail. Please help me, thanks.