Lore archive · Warcraft Wiki, 2023 dump
API GetGuildInfo
Last wiki revision 2022-07-26
Returns guild info for a player unit. guildName, guildRankName, guildRankIndex, realm = GetGuildInfo(unit)
- unit: : UnitId - The unit whose guild information you wish to query.
- guildName: - The name of the guild the unit is in (or nil?).
- guildRankName: - unit's rank in unit's guild.
- guildRankIndex: - unit's rank (index). - zero based index (0 is Guild Master, 1 and above are lower ranks)
- realm: - The name of the realm the guild is in, or nil if the guild's realm is the same as your current one
- This function only works in close proximity to the unit you are trying to get info from. It is the same distance that the character portrait loads if you are in party with them. It will abandon the data shortly after you leave the area, even if the portrait is remembered.
- If using with UnitId "player" on loading it happens that this value is nil even if the player is in a guild. Here's a little function which checks in the and events, if guild name is available. As long as it is not, no actions are fired by my guild event handling.
local function IsPlayerInGuild return IsInGuild and GetGuildInfo("player") end
Source
https://warcraft.wiki.gg/wiki/API_GetGuildInfo · retrieved 2023-11-13 · CC BY-SA 4.0
Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.
This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.