C_BattleNet.GetFriendAccountInfo

From Warcraft Wiki
Jump to navigation Jump to search
GitHub Octocat.png  Townlong-Yak BAD.png  ProfIcons engineering.png  BTNTemp.png C_BattleNet.GetFriendAccountInfo TheWarWithin-Icon-Inline.pngDragonflight-Icon-Inline.pngCata-Logo-Small.pngWrath-Logo-Small.pngWoW Icon update.png + 8.2.5 / 1.15.0
GitHub Octocat.png  Townlong-Yak BAD.png  ProfIcons engineering.png  BTNTemp.png C_BattleNet.GetAccountInfoByID TheWarWithin-Icon-Inline.pngDragonflight-Icon-Inline.pngCata-Logo-Small.pngWrath-Logo-Small.pngWoW Icon update.png + 8.2.5 / 1.15.0
GitHub Octocat.png  Townlong-Yak BAD.png  ProfIcons engineering.png  BTNTemp.png C_BattleNet.GetAccountInfoByGUID TheWarWithin-Icon-Inline.pngDragonflight-Icon-Inline.pngCata-Logo-Small.pngWrath-Logo-Small.pngWoW Icon update.png + 8.2.5 / 1.15.0
Wowprogramming.png  BTNTemp.png BNGetFriendInfo Cata-Logo-Small.pngWrath-Logo-Small.pngWoW Icon update.png + 3.3.5 / 1.13.2
Wowprogramming.png  BTNTemp.png BNGetFriendInfoByID Cata-Logo-Small.pngWrath-Logo-Small.pngWoW Icon update.png + 3.3.5 / 1.13.2

Returns information about a Battle.net friend account.

accountInfo = C_BattleNet.GetFriendAccountInfo(friendIndex [, wowAccountGUID])
            = C_BattleNet.GetAccountInfoByID(id [, wowAccountGUID])
            = C_BattleNet.GetAccountInfoByGUID(guid)

Arguments

GetFriendAccountInfo

friendIndex
number - Index ranging from 1 to BNGetNumFriends()
wowAccountGUID
string? : BNetAccountGUID

GetAccountInfoByID

id
number : bnetAccountID
wowAccountGUID
string? : BNetAccountGUID

GetAccountInfoByGUID

guid
string : UnitGUID

Returns

/spew output
accountInfo
BNetAccountInfo?
Field Type Description
bnetAccountID number A temporary ID for the friend's battle.net account during this session
accountName string A protected string representing the friend's full name or BattleTag name
battleTag string The friend's BattleTag (e.g., "Nickname#0001")
isFriend boolean
isBattleTagFriend boolean Whether or not the friend is known by their BattleTag
lastOnlineTime number The number of seconds elapsed since this friend was last online (from the epoch date of January 1, 1970). Returns nil if currently online.
isAFK boolean Whether or not the friend is flagged as Away
isDND boolean Whether or not the friend is flagged as Busy
isFavorite boolean Whether or not the friend is marked as a favorite by you
appearOffline boolean
customMessage string The Battle.net broadcast message
customMessageTime number The number of seconds elapsed since the current broadcast message was sent
note string The contents of the player's note about this friend
rafLinkType Enum.RafLinkType🔗
gameAccountInfo BNetGameAccountInfo
BNetGameAccountInfo
Field Type Description
gameAccountID number? A temporary ID for the friend's battle.net game account during this session.
clientProgram string BNET_CLIENT
isOnline boolean
isGameBusy boolean
isGameAFK boolean
wowProjectID number?
characterName string? The name of the logged in toon/character
realmName string? The name of the logged in realm
realmDisplayName string?
realmID number? The ID for the logged in realm
factionName string? The englishFaction name (i.e., "Alliance" or "Horde")
raceName string? The localized race name (e.g., "Blood Elf")
className string? The localized class name (e.g., "Death Knight")
areaName string? The localized zone name (e.g., "The Undercity")
characterLevel number? The current level (e.g., "90")
richPresence string? For WoW, returns "zoneName - realmName". For StarCraft 2 and Diablo 3, returns the location or activity the player is currently engaged in.
playerGuid string? A unique numeric identifier for the friend's character during this session.
isWowMobile boolean
canSummon boolean
hasFocus boolean Whether or not this toon is the one currently being displayed in Blizzard's FriendFrame
regionID number Added in 9.1.0
isInCurrentRegion boolean Added in 9.1.0
BNET_CLIENT
Global Value Description
BNET_CLIENT_WOW WoW World of Warcraft
BNET_CLIENT_APP App Battle.net desktop app
BNET_CLIENT_HEROES Hero Heroes of the Storm
BNET_CLIENT_CLNT CLNT

Details

Related API C_BattleNet.GetFriendGameAccountInfo

Example

Shows your own account info.

/dump C_BattleNet.GetAccountInfoByID(select(3, BNGetInfo()))

Shows your Battle.net friends' account information.

for i = 1, BNGetNumFriends() do
	local acc = C_BattleNet.GetFriendAccountInfo(i)
	local game = acc.gameAccountInfo
	print(acc.bnetAccountID, acc.accountName, game.gameAccountID, game.isOnline, game.clientProgram)
end
-- 1, "|Kq2|k", 5, true, "BSAp"
-- 2, "|Kq1|k", nil, false, ""

Patch changes

Battle for Azeroth Patch 8.2.5 (2019-09-24): Changed to C_BattleNet.GetFriendAccountInfo() and C_BattleNet.GetAccountInfoByID().[1]
Warlords of Draenor Patch 6.2.4 (2016-03-22): Replaced presenceID and presenceName with bnetIDAccount and accountName.
Mists of Pandaria Patch 5.0.4 (2012-08-28): Replaced givenName and surname with presenceName, battleTag, and isBattleTagPresence.
Wrath-Logo-Small.png Patch 3.3.5 (2010-06-22): Added as BNGetFriendInfo() and BNGetFriendInfoByID().