function PlayerThumbnailUtils.promiseUserName(v)assert(type(v)=="\110\117\109\098\101\114","\066\097\100 \117\115\101\114\073\100")local f f=Promise.spawn(function(N,D)local i=0 repeat i=i+1 local u local V,J=pcall(function()u=Players:GetNameFromUserIdAsync(v)end)if not V then return D(J)end if type(u)=="\115\116\114\105\110\103"then return N(u)else task.wait(.05)end until i>=MAX_TRIES or not f:IsPending()D()end)return f end return PlayerThumbnailUtils
--[=[
	Promises a player userName with retries enabled.
	@param userId number
	@return Promise<string>
]=]
function PlayerThumbnailUtils.promiseUserName(userId)
	assert(type(userId) == "number", "Bad userId")

	local promise
	promise = Promise.spawn(function(resolve, reject)
		local tries = 0
		repeat
			tries = tries + 1
			local name
			local ok, err = pcall(function()
				name = Players:GetNameFromUserIdAsync(userId)
			end)

			-- Don't retry if we immediately error (timeout exceptions!)
			if not ok then
				return reject(err)
			end

			if type(name) == "string" then
				return resolve(name)
			else
				task.wait(0.05)
			end
		until tries >= MAX_TRIES or (not promise:IsPending())
		reject()
	end)

	return promise
end

return PlayerThumbnailUtils
