Reference › Function reference › Platform

Platform.groups.GetGroupMembership

public

Call as

addon.Platform:GetGroupMembership(raidOnly)

Available directly through addon; no dependency is needed.

What it does

Read public group membership on identified client families. Unknown clients are unsupported. True raidOnly checks IsInRaid; false or nil checks IsInGroup using its native default group category. A readable false result stays false. Missing, failed, malformed or restricted observations return nil with a reason.

Arguments

NameTypeWhat it does
selfRMPlatformRotation Master platform adapter (implicit with colon calls).
raidOnlyboolean | nilTrue requests raid membership; false or nil requests any group membership.

Returns

1boolean | nilObserved membership, or nil when unavailable.
2string | nilValidation or availability reason for a nil result.

Editions

Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.

  • Not available on that edition (the reason is in the tooltip)
  • Only while Blizzard's deprecation fallbacks are on
Game APIClassic EraTBC AnniversaryClassic progressionForeverRetail
IsInGroupClassic EraTBC AnniversaryClassic progressionForeverRetail
IsInRaidClassic EraTBC AnniversaryClassic progressionForeverRetail

Secret values (Retail and Forever)

On Retail and Forever the game hands addons secret values. This helper checks what it reads (addon.Platform:CanReadValue) and returns nil with a reason such as restricted-value instead of a secret it cannot compare. Treat nil as unavailable, not as false.

Example

local grouped = addon.Platform:GetGroupMembership(false)
local raid = addon.Platform:GetGroupMembership(true)
if grouped == nil or raid == nil then return nil end
return grouped and not raid -- in a party, not a raid

Source

Platform/groups.lua, line 20. Read only in game; Duplicate makes an editable copy.

Platform.groups.GetGroupMembership(self, raidOnly)
    if not self:CanReadValue(raidOnly) then return nil,'restricted-value' end
    if raidOnly~=nil and type(raidOnly)~='boolean' then return nil,'invalid-group-query' end
    if self:GetClientFamily()=='unknown' then return nil,'unsupported-client' end
    local fn
    if raidOnly then fn=IsInRaid else fn=IsInGroup end
    if type(fn)~='function' then return nil,'missing-api' end
    local ok,member=pcall(fn)
    if not ok then return nil,'api-error' end
    if not self:CanReadValue(member) then return nil,'restricted-value' end
    if member==nil then return nil,'group-data-unavailable' end
    if type(member)~='boolean' then return nil,'invalid-api-result' end
    return member

Back to Function reference