Call as
addon.Platform:GetUnitGroupMembership(unit, raidOnly)
Available directly through addon; no dependency is needed.
What it does
Read a specified unit membership in the player party or raid. True raidOnly queries only UnitInRaid; otherwise a true UnitInParty result short-circuits, false proceeds to UnitInRaid, and unknown remains unavailable. Readable nil raid index means false; integer raid index1..40 means true. Names are passed unchanged to native APIs; native name-query acceptance requires client qualification.
Arguments
| Name | Type | What it does |
|---|---|---|
self | RMPlatform | Rotation Master platform adapter (implicit with colon calls). |
unit | string | Readable nonempty unit token or native-recognized name, passed unchanged. |
raidOnly | boolean | nil | True checks raid membership only; false or nil checks party then raid. |
Returns
| 1 | boolean | nil | Observed membership, or nil when unavailable. |
|---|---|---|
| 2 | string | nil | Validation 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 API | |||||
|---|---|---|---|---|---|
UnitInParty | |||||
UnitInRaid | |||||
canaccessvalue |
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 member = addon.Platform:GetUnitGroupMembership("focus", false)
if member == nil then return nil end
return memberSource
Platform/groups.lua, line 45. Read only in game; Duplicate makes an editable copy.
Platform.groups.GetUnitGroupMembership(self, unit, raidOnly)
if not self:CanReadValue(unit) or not self:CanReadValue(raidOnly) then return nil,'restricted-value' end
if type(unit)~='string' or unit=='' or #unit>512 or unit:find('[%z\1-\31\127]') then return nil,'invalid-unit' 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
if not raidOnly then
if type(UnitInParty)~='function' then return nil,'missing-api' end
local ok,member=pcall(UnitInParty,unit)
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
if member then return true end
end
if type(UnitInRaid)~='function' then return nil,'missing-api' end
local ok,index=pcall(UnitInRaid,unit)
if not ok then return nil,'api-error' end
if not self:CanReadValue(index) then return nil,'restricted-value' end
if canaccessvalue and not canaccessvalue(index) then return nil,'restricted-value' end
-- The pinned native API returns an optional raid index: nil is nonmember.
if index==nil then return false end
if type(index)~='number' or index<1 or index>40 or index%1~=0 then return nil,'invalid-api-result' end
return true




