Discord webhooks - How to show the player's profile pic

Hi, i’m currently creating a reporting system and i was wondering how I can add their profile pic to the embed. Here is my code:

local webhookURL = no
local filteringFunction = game.ReplicatedStorage.UserReporting

local ChatService = game:GetService("Chat")

local HTTP = game:GetService("HttpService")

function filteringFunction.OnServerInvoke(player, msg)
	local FilteredMessage = ChatService:FilterStringForBroadcast(msg, player)	
        --Filter the message, before sending it to the webhook.

	local payload = HTTP:JSONEncode({
		
		["embeds"] = {
			
			{
				["title"] = "Submitted By "..player.Name,
				["description"] = FilteredMessage,
				["color"] = 5158332
			}
		}
	})
	
	HTTP:PostAsync(webhookURL, payload)
	return "Feedback recieved!"
end
3 Likes

Check out Players:GetUserThumbnailAsync.

1 Like

You can use the thumbnail field of the embed and GetUserThumbnailAsync, as @ahmettrPro2 said:

{
				["title"] = "Submitted By "..player.Name,
				["description"] = FilteredMessage,
				["color"] = 5158332,
                ["thumbnail"] = {url = game.Players:GetUserThumbnailAsync(player.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)}
			}

Excuse the bad formatting – I typed this on mobile

5 Likes