C_FriendList.GetFriendInfo

From Warcraft Wiki
Jump to navigation Jump to search
GitHub Octocat.png  Townlong-Yak BAD.png  ProfIcons engineering.png  BTNTemp.png C_FriendList.GetFriendInfo TheWarWithin-Icon-Inline.pngDragonflight-Icon-Inline.pngCata-Logo-Small.pngWrath-Logo-Small.pngWoW Icon update.png + 8.1.0 / 1.13.2
GitHub Octocat.png  Townlong-Yak BAD.png  ProfIcons engineering.png  BTNTemp.png C_FriendList.GetFriendInfoByIndex TheWarWithin-Icon-Inline.pngDragonflight-Icon-Inline.pngCata-Logo-Small.pngWrath-Logo-Small.pngWoW Icon update.png + 8.1.0 / 1.13.2
Wowprogramming.png  BTNTemp.png GetFriendInfo + 1.0.0

Retrieves information about a person on your friends list.

info = C_FriendList.GetFriendInfo(name)
     = C_FriendList.GetFriendInfoByIndex(index)

Arguments

GetFriendInfo

name
string - name of friend in the friend list.

GetFriendInfoByIndex

index
number - index of the friend, up to C_FriendList.GetNumFriends() limited to max 100.

Returns

info
FriendInfo
Field Type Description
connected boolean If the friend is online
name string
className string? Friend's class, or "Unknown" (if offline)
area string? Current location, or "Unknown" (if offline)
notes string?
guid string GUID, example: "Player-1096-085DE703"
level number Friend's level, or 0 (if offline)
dnd boolean If the friend's current status flag is DND
afk boolean If the friend's current status flag is AFK
rafLinkType Enum.RafLinkType🔗
mobile boolean
Enum.RafLinkType
Value Field Description
0 None
1 Recruit
2 Friend
3 Both

Details

  • Friend information isn't necessarily automatically kept up to date. You can use C_FriendList.ShowFriends() to request an update from the server.

Example

local f = C_FriendList.GetFriendInfoByIndex(1)
print(format("Your friend %s (level %d %s) is in %s", f.name, f.level, f.className, f.area))
-- Your friend Aërto (level 74 Warrior) is in Sholazar Basin

Patch changes

Battle for Azeroth Patch 8.2.5 (2019-09-24): Added rafLinkType field.
Battle for Azeroth Patch 8.2.0 (2019-06-25): Added mobile field.
Battle for Azeroth Patch 8.1.0 (2018-12-11): Moved to C_FriendList.GetFriendInfo()[1]
Bc icon.gif Patch 2.4.0 (2008-03-25): Added note return.[2]
WoW Icon update.png Patch 1.0.0 (2004-10-08): Added as GetFriendInfo()