so I’ve got this script that sends a message to discord via webhook
but I’ve got one problem. the thumbnail doesnt work and I researched about it. I then found out that Players:GetUserThumbnailAsync() actually returned a rbxthumb instead of a https://
I then tried using the legacy url and this is what I have now
script in serverscriptservice:
local url = thisisprivate
local hs = game:GetService("HttpService")
game:GetService("ReplicatedStorage"):WaitForChild("SendFeedback").OnServerEvent:Connect(function(player, feedback)
local data = {
content = feedback,
embeds = nil,
username = string.format("%s (%s)", player.DisplayName, player.Name),
avatar_url = "https://www.roblox.com/headshot-thumbnail/image?userId="..player.UserId.."&width=420&height=420&format=png"
}
local finaldata = hs:JSONEncode(data)
hs:PostAsync(url, finaldata)
end)
You sadly have to use a Roblox api endpoint to achieve this.
Thankfully roproxy exists.
I put together a code for you here:
function headshotToURL(id)
local icon_url = "https://thumbnails.roproxy.com/v1/users/avatar-headshot?userIds=" .. id .. "&size=420x420&format=Png&isCircular=false"
local response = http:GetAsync(icon_url)
local data = http:JSONDecode(response)
return data["data"][1]["imageUrl"]
end