Discord Webhook User Thumbnail

It seems that Discord wants a .png extension appended to the URL rather than the thumbnail link by itself. Using these image endpoints do not seem to be working properly with webhooks, since Discord is just ignoring the thumbnail altogether at this point.

function embed:SetPlayerThumbnail(player)
	self.embeds[1].thumbnail.url = ("https://roblox.com/outfit-thumbnail/image?userOutfitId=%s&width=420&height=420&format=png"):format(player.UserId)
end

Does anybody have a workaround for this?

My webhook wasnt made in lua however I used the api for:
https://thumbnails.roblox.com/v1/users/avatar-headshot?userIds={IdHere}&size=60x60&format=Png&isCircular=false

In lua it should be something like:

HTTPService:JSONDecode(HTTPService:GetAsync("https://thumbnails.rprxy.xyz/v1/users/avatar-headshot?userIds={USERIDHERE}&size=60x60&format=Png&isCircular=false"))["data"][1]["imageUrl"]

Thanks, I noticed that second endpoint in the replies of the post I mentioned, but didn’t rlly want to go through the trouble of using a proxy just to get the actual url, I will test this.

You don’t actually have to use a proxy on roblox you simply have to replace roblox.com with rprxy.xyz at least from the experience I have with using roblox endpoints in studio

You’re using the wrong thumbnail URL parameter.

You are using “OutfitId” but you are passing the UserId of the player. Use the userId parameter with a different URL (such as “bust-thumbnail”).

self.embeds[1].thumbnail.url = ("https://www.roblox.com/bust-thumbnail/image?userId=%d&width=420&height=420&format=png"):format(player.UserId)

You are absolutely right, unfortunately, Discord still isn’t accepting it because of the reason I mentioned in the original post.

Might just go with no thumbnail for now. It’s not entireeely necessary but would be a nice addition.

Or you can just use the thing I sent you and replace {USERIDHERE} with the userid which should work with what @DrKittyWaffles sent

1 Like

Sorry I had work. I’m home now. The issue is not because you do not have a .png extension. png files have a header in the data of the file so that you know it is a png–it isnt a png just because it has an extension “.png”

I created a small example and everything works for me. discord embed.rbxl (30.5 KB)

local Players = game:GetService("Players")

local Discord = require(script.Discord)
local Webhook, Embed, EmbedField = Discord.Webhook, Discord.Embed, Discord.EmbedField

local Robot = Webhook.new()
	:SetUsername("Robot")
	:SetAvatarURL("https://static.wikia.nocookie.net/sonic/images/5/52/Knuckles_9.png/revision/latest?cb=20180610104248")
	:SetToken("https://canary.discord.com/api/webhooks/-/-")

local function LogPlayer(Player)
	local Info = EmbedField.new()
		:SetName("Name: ")
		:SetValue(Player.Name)
	
	local Message = Embed.new()
		:SetTitle("Player Joined")
		:SetDescription(Player.Name .. " has joined the game!")
		:SetThumbnail(string.format("https://www.roblox.com/bust-thumbnail/image?userId=%d&width=420&height=420&format=png", Player.UserId))
		:SetColor(0xFF0000)
		:AddField(Info)
	
	Robot
		:SetContent("TEST")
		:AddEmbed(Message)
		:Post()
end

Players.PlayerAdded:Connect(LogPlayer)

image

1 Like