Wowpedia

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

READ MORE

Wowpedia
No edit summary
Tag: WoW API docs
Tag: WoW API docs
(13 intermediate revisions by 3 users not shown)
Line 6: Line 6:
 
==Arguments==
 
==Arguments==
 
===<font color="#4ec9b0">GetFriendInfo</font>===
 
===<font color="#4ec9b0">GetFriendInfo</font>===
āˆ’
;name : <font color="#ecbc2a">string</font> - name of friend in the friend list.
+
;name : <span class="apitype">string</span> - name of friend in the friend list.
   
 
===<font color="#4ec9b0">GetFriendInfoByIndex</font>===
 
===<font color="#4ec9b0">GetFriendInfoByIndex</font>===
āˆ’
;index : <font color="#ecbc2a">number</font> - index of the friend, up to {{api|C_FriendList.GetNumFriends}}() (max 100). Note that status changes can re-order the friend list and indices.
+
;index : <span class="apitype">number</span> - index of the friend, up to {{api|C_FriendList.GetNumFriends}}() limited to max 100.
   
 
==Returns==
 
==Returns==
āˆ’
;info : <font color="#ecbc2a">FriendInfo</font>
+
;info : <span class="apitype">FriendInfo</span>
 
{| class="sortable darktable zebra" style="margin-left: 2em"
 
{| class="sortable darktable zebra" style="margin-left: 2em"
 
! Key !! Type !! Description
 
! Key !! Type !! Description
 
|-
 
|-
āˆ’
| connected || <font color="#ecbc2a">boolean</font> || If the friend is online
+
| connected || <span class="apitype">boolean</span> || If the friend is online
 
|-
 
|-
āˆ’
| name || <font color="#ecbc2a">string</font> || Friend's name
+
| name || <span class="apitype">string</span> ||
 
|-
 
|-
āˆ’
| className || <font color="#ecbc2a">string</font>? || Friend's class, or "Unknown" (if offline)
+
| className || <span title="nilable"><span class="apitype">string</span>?</span> || Friend's class, or "Unknown" (if offline)
 
|-
 
|-
āˆ’
| area || <font color="#ecbc2a">string</font>? || Friend's current location, or "Unknown" (if offline)
+
| area || <span title="nilable"><span class="apitype">string</span>?</span> || Current location, or "Unknown" (if offline)
 
|-
 
|-
āˆ’
| notes || <font color="#ecbc2a">string</font>? || Friend's note
+
| notes || <span title="nilable"><span class="apitype">string</span>?</span> ||
 
|-
 
|-
āˆ’
| guid || <font color="#ecbc2a">string</font> || Friend's [[GUID]], example: "Player-1096-085DE703"
+
| guid || <span class="apitype">string</span> || [[GUID]], example: "Player-1096-085DE703"
 
|-
 
|-
āˆ’
| level || <font color="#ecbc2a">number</font> || Friend's level, or 0 (if offline)
+
| level || <span class="apitype">number</span> || Friend's level, or 0 (if offline)
 
|-
 
|-
āˆ’
| dnd || <font color="#ecbc2a">boolean</font> || 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 || <font color="#ecbc2a">boolean</font> || 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 || <font color="#ecbc2a">Enum.RafLinkType</font> ||
+
| rafLinkType || <span class="apitype">Enum.RafLinkType</span> ||
 
|-
 
|-
āˆ’
| mobile || <font color="#ecbc2a">boolean</font> ||
+
| mobile || <span class="apitype">boolean</span> ||
 
|}
 
|}
   
Line 42: Line 42:
   
 
==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)
+
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==
āˆ’
* {{Patch 8.2.0|note=Added mobile field.}}
+
* {{Patch 8.2.5|note=Added <code>rafLinkType</code> field.}}
  +
* {{Patch 8.2.0|note=Added <code>mobile</code> field.}}
āˆ’
* {{Patch 8.1.0|note=Moved to <code>C_FriendList.GetFriendInfo()</code>. The previous alias is deprecated. [https://www.townlong-yak.com/framexml/8.1.5/Blizzard_Deprecated/Deprecated_8_1_0.lua#70]}}
 
āˆ’
* {{Patch 2.4.0|note=Added fifth return value, note. [https://www.townlong-yak.com/framexml/2.4.0/FriendsFrame.lua/diff#201]}}
+
* {{Patch 8.1.0|note=Moved to <code>C_FriendList.GetFriendInfo()</code><sup>[https://www.townlong-yak.com/framexml/8.1.5/Blizzard_Deprecated/Deprecated_8_1_0.lua#70]</sup>}}
  +
* {{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>}}
 
* {{Patch 1.1.0|note=Added as <code>GetFriendInfo()</code>}}
āˆ’  
āˆ’
==External Links==
 
āˆ’
<!-- Please read https://wow.gamepedia.com/Wowpedia:External_links_policy before adding new links. -->
 
āˆ’
{{Elinks-api|t=a|namespace=C_FriendList|system=FriendList}}
 

Revision as of 12:17, 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