Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
Tag: WoW API docs
Tag: WoW API docs
Line 45: Line 45:
   
 
==Example==
 
==Example==
  +
<syntaxhighlight lang="lua">
āˆ’
local f = C_FriendList.GetFriendInfoByIndex(1)
+
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))
+
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
+
-- Your friend AĆ«rto (level 74 Warrior) is in Sholazar Basin
  +
</syntaxhighlight>
   
 
==Patch changes==
 
==Patch changes==

Revision as of 12:14, 24 September 2021

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
Key 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