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.
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.
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.
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.
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.
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.
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