function GroupUtils.promiseGroupRoleInfo(I,T)assert(I,"\066\097\100 \103\114\111\117\112\073\100")assert(T,"\066\097\100 \114\097\110\107\073\100")return(GroupUtils.promiseGroupInfo(I)):Then(function(I)if type(I.Roles)~="\116\097\098\108\101"then return Promise.rejected("\078\111 \082\111\108\101\115 \116\097\098\108\101")end for I,N in pairs(I.Roles)do if N.Rank==T then return N end end return Promise.rejected("\078\111 \114\097\110\107 \119\105\116\104 \103\105\118\101\110 \105\100")end)end return GroupUtils
--[=[
	Retrieves group role info for a given rankId

	@param groupId number
	@param rankId number
	@return Promise<table>
]=]
function GroupUtils.promiseGroupRoleInfo(groupId, rankId)
	assert(groupId, "Bad groupId")
	assert(rankId, "Bad rankId")

	return GroupUtils.promiseGroupInfo(groupId):Then(function(groupInfo)
		if type(groupInfo.Roles) ~= "table" then
			return Promise.rejected("No Roles table")
		end

		for _, rankInfo in pairs(groupInfo.Roles) do
			if rankInfo.Rank == rankId then
				return rankInfo
			end
		end

		return Promise.rejected("No rank with given id")
	end)
end

return GroupUtils
