C_BattleNet.GetFriendAccountInfo

From Warcraft Wiki
Jump to navigation Jump to search
GitHub Octocat.png  Townlong-Yak Globe.png  Townlong-Yak BAD.png  Blizz.gif  ProfIcons engineering.png C_BattleNet.GetFriendAccountInfo 12.0.0 (63854)11.2.7 (63853)5.5.2 (63832)1.15.8 (63829) + 8.2.5 / 3.4.0 / 1.14.4
AllowedWhenUntainted
GitHub Octocat.png  Townlong-Yak Globe.png  Townlong-Yak BAD.png  Blizz.gif  ProfIcons engineering.png C_BattleNet.GetAccountInfoByID 12.0.0 (63854)11.2.7 (63853)5.5.2 (63832)1.15.8 (63829) + 8.2.5 / 3.4.0 / 1.14.4
AllowedWhenUntainted
GitHub Octocat.png  Townlong-Yak Globe.png  Townlong-Yak BAD.png  Blizz.gif  ProfIcons engineering.png C_BattleNet.GetAccountInfoByGUID 12.0.0 (63854)11.2.7 (63853)5.5.2 (63832)1.15.8 (63829) + 8.2.5 / 3.4.0 / 1.14.4
AllowedWhenUntainted
GitHub Octocat.png  Townlong-Yak Globe.png  Wowprogramming.png BNGetFriendInfo 5.5.2 (63832)1.15.8 (63829) + 3.3.5 / 1.13.2
GitHub Octocat.png  Townlong-Yak Globe.png  Wowprogramming.png BNGetFriendInfoByID 5.5.2 (63832)1.15.8 (63829) + 3.3.5 / 1.13.2

World of Warcraft API

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 Kstring representing the friend's full name or BattleTag name.
battleTag string The friend's BattleTag (e.g., "Nickname#0001")
isFriend boolean
isBattleTagFriend boolean
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 Awayther or not the friend is flagged as Busy
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 WOWGUID? : string A unique numeric identifier for the friend's character during this session.
canSummon boolean
hasFocus boolean Whether or not this toon is the one currently being displayed in Blizzard's FriendFrame
regionID number 9.1.0
isInCurrentRegion boolean 9.1.0
timerunningSeasonID number? 10.2.7
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