Discord embed problem?

Hi, I’m not sure what is causing this with my embed but for some reason the players thumbnail doesn’t show anymore. Is this something to do with Roblox? I have tested it on a client and it worked perfectly on an image label.

thumbnail = {
url = "http://www.roblox.com/Thumbs/Avatar.ashx?x=150&y=150&Format=Png&userid=" .. Player.UserId
},

1 Like

Hello,

Do you want a head-shot thumbail of the player?


If so, you can use :

game.Players:GetUserThumbnailAsync(Player.UserId, ThumbnailType, ThumbnailSize)

You can also use: [But I recommend you to use the method above.]

https://www.roblox.com/headshot-thumbnail/image?userId=..Player.UserId ..&width=420&height=420&format=png

Sadly, Roblox has blocked access to all Discord related stuff [webhooks], so you will not be able to send the thumbnail to a webhook.


You can also read more about Engine API on this Roblox Document below.

https://create.roblox.com/docs/reference/engine/classes/Players

1 Like

I don’t believe Discord can make calls to Roblox (and the same goes for Roblox to Discord.)

My reasoning for this: I don’t know, honestly. But the thing is, since you’re using a Roblox API call to get the image, and sending that to Discord, Discord probably won’t get the image. :person_shrugging:

This could very well just be false information that I’m giving, but it’s the only reasonable solution. I’ve been experimenting with Discord’s API (not Roblox > Discord, but JS > Discord), and the thumbnail works fine for me.

Also, you’re passing a link, not an image, so that’s further proof that Discord might not accept Roblox’s API.

Yeah it seems that discord has blocked roblox servers.

Pretty sure this can be bypassed using a proxy though.

Yeah, but it’s kind of odd if they blocked their own servers from calling Roblox’s API, don’t you think?

I don’t know, though.

Put simply, that endpoint doesn’t exist. At least, not anymore - Roblox removed pretty much every direct thumbnail endpoint. You’ll have to make a request to thumbnails.roblox.com/v1/users/avatar-headshot and use the image url provided in the response.

1 Like

Apparently it was agianst Discord’s ToS
image

Oh, so this is a roblox issue? The endpoint above should work is what your saying?

Right, which is why people use proxies now.

1 Like

No, it’s been intentionally removed. They started removing those endpoints some time ago, actually. Only reason they still work in studio is because Roblox automatically transforms them to the new in-game rbxthumb:// format.

I’m confused then, so can I get the players thumbnail for my embed or not?

Yes - but you’ll have to make a POST request to the endpoint I mentioned. There’s no longer an endpoint that can be used to embed an image directly.

So I have to use a proxy to get the players thumbnail? That’s what it sounds like to me, I just hope some type of proxy already exist for this exact reason otherwise I’ll have to figure something else out.

A current proxy I trust is “https://hooks.hyra.io/

For the other issue, the method you were using will not work as I dont believe that’s valid anymore because I dont think that returns any image data?

GetUserThumbnailAsync
prints
rbxthumb://type=AvatarHeadShot&id=UserID&w=420&h=420 true

From my knowledge that could work as Discord trys to receive image data given by user. Ill keep searching for other methods.

1 Like

rbxthumb:// links won’t work in embeds as most people have stated here, Discord doesn’t know how to pull that information. The information you’re looking for has already been posted, there is pretty much no way anymore to get the players thumbnail internally from Roblox and send it off to an external such as Discord, however making a request to the dedicated API is probably what you’re looking for.

Free proxies do exist for this purpose such as RoProxy. Here is some code to base yours off of which uses RoProxy as well as hooks.hyra .

local HTTP = game:GetService("HttpService")


local function SendWebhook(PlayerId)
	local Response;
	local HyraWebhook = "https://hooks.hyra.io/api/webhooks/"
	local RoproxyURL = string.format("https://thumbnails.roproxy.com/v1/users/avatar-headshot?userIds=%s&size=420x420&format=Png&isCircular=false", PlayerId)
	
	local succ, err = pcall(function()
		Response = HTTP:GetAsync(RoproxyURL)
	end)
	
	if succ then
		local ImageURL = HTTP:JSONDecode(Response)["data"][1]["imageUrl"]
		local WebhookData = {
			["content"] = "Content", 
			["embeds"] = {
				{["thumbnail"] = { 
						["url"] = ImageURL
					},	
					["title"] = 'Title',
					["description"] = "Description",
					["color"] = tonumber(0xffffff),
				}
			}
		};
		
		local JSData = HTTP:JSONEncode(WebhookData) 
		HTTP:PostAsync(HyraWebhook, JSData)
	end
end


2 Likes