Image not displaying on Discord Embed

When the request is sent to discord, the image isn’t displaying on the embed.

Embed Preview:
image

Code:

function reportPlayer(admin, UserID, length, reason)
	if debounce then return end
	debounce = true
	local userID = tonumber(UserID)
	local Player = Players:GetNameFromUserIdAsync(userID)
	local ThumbnailID = string.format("https://www.roblox.com/asset-thumbnail/image?assetId=%d&width=420&height=420&format=png", userID)
	local data = { 
		['embeds'] = {{
			['title'] = "Player Banned",
			['description'] = "",
			['color'] = tonumber(0x9c4141), 
			['thumbnail'] = {
				["url"] = ThumbnailID, 
				["height"] = 420,
				["width"] = 420
			},
			['fields'] = {
				{
					['name'] = "**Banned Player:**",
					['value'] = Player,
					['inline'] = true
				},
				{
					['name'] = "**Moderator:**",
					['value'] = admin.Name,
					['inline'] = true
				},
				{
					['name'] = "**Profile Link for banned player**",
					['value'] = "[Proflie](https://www.roblox.com/users/"..userID.."/profile)",
					['inline'] = true
				},
				{
					['name'] = "**Date**",
					['value'] = os.date("*t")["hour"]..":"..os.date("*t")["min"].." | "..os.date("*t")["day"].."/"..os.date("*t")["month"].."/"..os.date("*t")["year"],
					['inline'] = true
				},
				{
					['name'] = "**Reason**",
					['value'] = reason,
					['inline'] = true
				},
				{
					['name'] = "**Banned Length**",
					['value'] = length.." seconds",
					['inline'] = true
				}
			}
		}}
	}
	local finaldata = http:JSONEncode(data)
	http:PostAsync(url, finaldata)
	task.wait(300)
	debounce = false
end

If you try going to the URL you sent and replace %d with a user id, you’ll see that it goes to a 404 page, rather than an image.

Because there’s not an image at the URL, discord has nothing to display

3 Likes

Those images only work within Roblox and cannot be used in other applications as @SeargentAUS said. You’ll have to either use Roblox’s API (which you can’t in Roblox games) or try something else like getting the user thumbnail but I’m not sure if the function gets the URL or not.

Then how did this person do it??

They just used a modules to make the up the url??

That’s 2 years ago. Policies changed such that it doesn’t work anymore.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.