Overview
The friends system allows your bot to manage friendships, send messages, and track friend status. Friends are represented by theFriend class and pending requests by IncomingPendingFriend and OutgoingPendingFriend.
Friend Classes
Friend
Represents an accepted friend. Key Attributes:id- Friend’s account IDdisplay_name- Friend’s display nameepicgames_account- Whether friend has an Epic Games accountstatus- Friendship status (usually “ACCEPTED”)incoming/outgoing- Whether friend sent or received the requestcreated_at- When the friendship was createdfavorite- Whether the friend is favoritednickname- Custom nickname set for this friendnote- Note attached to this friendlast_presence- Last received presence datalast_logout- Last time friend logged outplatform- Current platform (if online)
IncomingPendingFriend
Represents a received friend request. Key Methods:accept()- Accept the friend requestdecline()- Decline the friend request
OutgoingPendingFriend
Represents a sent friend request. Key Methods:cancel()/abort()- Cancel the sent request
Accessing Friends
Get All Friends
Get Pending Requests
Get Specific Friend
Managing Friends
Adding Friends
Accepting Friend Requests
Declining Friend Requests
Removing Friends
Canceling Outgoing Requests
Friend Information
Check Online Status
Wait for Friend Status
Fetch Last Logout Time
Fetch Mutual Friends
Nicknames and Notes
Set Nickname
Remove Nickname
Set Note
Remove Note
Sending Messages
Blocking Users
Party Operations
Join Friend’s Party
Invite Friend to Party
Request to Join Friend
Friend Events
Friend Added
Friend Removed
Friend Presence Changed
Friend Request Received
Advanced Patterns
Auto-accept from Whitelist
Track Friend Activity
Notification System
Best Practices
Check friend limits
Most accounts have a 1000 friend limit. Handle
MaxFriendshipsExceededUse IDs, not names
Always use friend IDs instead of display names for reliability
Handle offline friends
Check
is_online() before accessing presence dataRespect rate limits
Don’t spam friend requests or messages
Common Issues
Friend Not in List
If a friend doesn’t appear inclient.friends, they might be a pending request:
Presence is None
Presence might beNone if the friend hasn’t sent presence data yet:
Next Steps
Messages
Learn how to send and receive messages
Presence
Understand presence and status tracking
Parties
Join and manage party lobbies
Events
Handle friend-related events