No edit summary |
Tag: WoW API docs |
||
(19 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{wowapi|t=a|namespace=C_FriendList|system=FriendList}} |
||
ā | {{wowapi}} |
||
Retrieves information about a person on your friends list. |
Retrieves information about a person on your friends list. |
||
ā | |||
info = C_FriendList.GetFriendInfo(name) |
info = C_FriendList.GetFriendInfo(name) |
||
= C_FriendList.GetFriendInfoByIndex(index) |
= C_FriendList.GetFriendInfoByIndex(index) |
||
ā | ==Arguments |
+ | ==Arguments== |
+ | ===<font color="#4ec9b0">GetFriendInfo</font>=== |
||
ā | ;name : |
+ | ;name : <span class="apitype">string</span> - name of friend in the friend list. |
ā | == |
+ | ===<font color="#4ec9b0">GetFriendInfoByIndex</font>=== |
ā | ;index : number - index of the friend, up to {{api|C_FriendList.GetNumFriends}} |
+ | ;index : <span class="apitype">number</span> - index of the friend, up to {{api|C_FriendList.GetNumFriends}}() limited to max 100. |
==Returns== |
==Returns== |
||
ā | ;info : |
+ | ;info : <span class="apitype">FriendInfo</span> |
⚫ | |||
ā | |||
⚫ | |||
⚫ | |||
! Key !! Type !! Description |
! Key !! Type !! Description |
||
|- |
|- |
||
ā | | connected || boolean || If the friend is online |
+ | | connected || <span class="apitype">boolean</span> || If the friend is online |
|- |
|- |
||
ā | | name || string || |
+ | | name || <span class="apitype">string</span> || |
|- |
|- |
||
ā | | className || |
+ | | className || <span title="nilable"><span class="apitype">string</span>?</span> || Friend's class, or "Unknown" (if offline) |
|- |
|- |
||
ā | | area || |
+ | | area || <span title="nilable"><span class="apitype">string</span>?</span> || Current location, or "Unknown" (if offline) |
|- |
|- |
||
ā | | notes || |
+ | | notes || <span title="nilable"><span class="apitype">string</span>?</span> || |
|- |
|- |
||
ā | | guid || string || |
+ | | guid || <span class="apitype">string</span> || [[GUID]], example: "Player-1096-085DE703" |
|- |
|- |
||
ā | | level || number || Friend's level, or 0 (if offline) |
+ | | level || <span class="apitype">number</span> || Friend's level, or 0 (if offline) |
|- |
|- |
||
ā | | dnd || boolean || If the friend's current status flag is DND |
+ | | dnd || <span class="apitype">boolean</span> || If the friend's current status flag is DND |
|- |
|- |
||
ā | | afk || boolean || If the friend's current status flag is AFK |
+ | | afk || <span class="apitype">boolean</span> || If the friend's current status flag is AFK |
|- |
|- |
||
+ | | rafLinkType || <span class="apitype">Enum.RafLinkType</span> || |
||
ā | | referAFriend || boolean || If your friend was recruited through [[Recruit-A-Friend]] |
||
⚫ | |||
+ | | mobile || <span class="apitype">boolean</span> || |
||
|} |
|} |
||
+ | |||
+ | {{:Enum_RecruitAFriendShared.RafLinkType}} |
||
==Details== |
==Details== |
||
ā | * Friend information isn't necessarily automatically kept up to date. You can use {{api|C_FriendList.ShowFriends}} to request an update from the server. |
+ | * Friend information isn't necessarily automatically kept up to date. You can use {{api|C_FriendList.ShowFriends}}() to request an update from the server. |
==Example== |
==Example== |
||
+ | <syntaxhighlight lang="lua"> |
||
ā | + | 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 |
|
+ | </syntaxhighlight> |
||
==Patch changes== |
==Patch changes== |
||
+ | * {{Patch 8.2.5|note=Added <code>rafLinkType</code> field.}} |
||
⚫ | |||
+ | * {{Patch 8.2.0|note=Added <code>mobile</code> field.}} |
||
ā | |||
⚫ | |||
ā | ==See also== |
||
ā | * [https://www.townlong-yak.com/framexml/ |
+ | * {{Patch 2.4.0|note=Added <code>note</code> return.<sup>[https://www.townlong-yak.com/framexml/2.4.0/FriendsFrame.lua/diff#201]</sup>}} |
+ | * {{Patch 1.1.0|note=Added as <code>GetFriendInfo()</code>}} |
Revision as of 12:17, 24 September 2021
Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
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 |
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
- Patch 8.2.5 (2019-09-24): Added
rafLinkType
field. - Patch 8.2.0 (2019-06-25): Added
mobile
field. - Patch 8.1.0 (2018-12-11): Moved to
C_FriendList.GetFriendInfo()
[1] - Patch 2.4.0 (2008-03-25): Added
note
return.[2] - Patch 1.1.0 (2004-11-07): Added as
GetFriendInfo()