-- For AwardBadge

function module.applyBadgeFunction(badgeId: number, func: badgeFunction): boolean?
	if Functions.badges[badgeId] then return true end
	local success, errorMessage, badgeInfo

	success, errorMessage = pcall(function()
		badgeInfo = BadgeService:GetBadgeInfoAsync(badgeId)
	end)
	
	assert(badgeInfo, `BadgeService error: {errorMessage}`)
	if not badgeInfo.IsEnabled then return nil end
	
	Functions.badges[badgeId] = func

	return true
end
