wowpedia
Main Menu


Returns guild info for a player unit.

guildName, guildRankName, guildRankIndex, realm = GetGuildInfo(unit)

Arguments

unit
string : UnitId - The unit whose guild information you wish to query.

Returns

guildName
string - The name of the guild the unit is in (or nil?).
guildRankName
string - unit's rank in unit's guild.
guildRankIndex
number - unit's rank (index). - zero based index (0 is Guild Master, 1 and above are lower ranks)
realm
string? - The name of the realm the guild is in, or nil if the guild's realm is the same as your current one

Details

local function IsPlayerInGuild()
    return IsInGuild() and GetGuildInfo("player")
end