Skip to main content

Overview

The NTQQFriendApi class provides methods for managing friend lists, handling friend requests, and performing friend-related operations.

Friend List

getBuddy

Get the complete friend list.
FriendV2[]
Array of friend objects with detailed information
Example:

getBuddyV2SimpleInfoMap

Get friend list as a map of UID to user info.
Map<string, FriendV2>
Map with UID as key and friend info as value

getBuddyIdMap

Get a map of UIN to UID for friends.
LimitedHashTable<string, string>
Hash table mapping UIN to UID
Example:

getBuddyV2ExWithCate

Get friend list with category information.
Array<CategoryInfo>
Array of friend categories with their members
Example:

Friend Management

isBuddy

Check if a user is a friend.
string
required
User UID to check
boolean
true if user is a friend, false otherwise
Example:

setBuddyRemark

Set remark/note for a friend.
string
required
Friend UID
string
required
New remark text
Example:

delBuddy

Delete a friend.
string
required
Friend UID to delete
boolean
default:"false"
Whether to temporarily block the user
boolean
default:"false"
Whether to delete from both sides
Example:

Friend Requests

getBuddyReq

Get list of pending friend requests.
FriendRequest[]
Array of friend request objects
Example:

handleFriendRequest

Approve or reject a friend request.
FriendRequest
required
Friend request object from getBuddyReq()
boolean
required
true to accept, false to reject
Example:

clearBuddyReqUnreadCnt

Clear unread count for friend requests.
Example:

Doubt Friend Requests

“Doubt” friend requests are requests that need additional verification.

getDoubtFriendRequest

Get list of doubt friend requests.
number
required
Number of requests to retrieve
Array<DoubtRequest>
Array of doubt friend request objects
Example:

handleDoubtFriendRequest

Handle a doubt friend request.
string
required
Friend UID from doubt request
string
default:"''"
Additional parameter 1
string
default:"''"
Additional parameter 2
Example:

Complete Example

Here’s a complete example of handling friend requests:

Notes

  • Friend operations may require appropriate permissions
  • UIDs and UINs are different identifiers - use conversion methods from UserApi if needed
  • Friend requests have expiration times and may become invalid
  • Some operations may have rate limits imposed by QQ servers