Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/xmistt/rebootpy/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The Client class represents the full-featured client connected to Fortnite and EpicGames’ services. It extends BasicClient with support for:
  • Parties and party management
  • Friends and friendship management
  • XMPP messaging
  • Presence and status updates
  • Real-time events

Constructor

Client(
    auth: Auth,
    **kwargs
)
auth
Auth
required
The authentication method to use. See Authentication for available methods.
http_connector
aiohttp.BaseConnector
The connector to use for HTTP connection pooling.
ws_connector
aiohttp.BaseConnector
The connector to use for websocket connection pooling.
status
str
default:"{current_playlist}"
The status message sent with presence to friends. Supports variables:
  • {party_size} - Number of players in the party
  • {party_max_size} - Maximum party size
  • {current_playlist} - Current playlist name (e.g., “Battle Royale”)
away
AwayStatus
default:"AwayStatus.ONLINE"
The away status for the client’s presence.
platform
Platform
default:"Platform.WINDOWS"
The platform to display as the client’s source.
net_cl
str
default:""
The current net CL used by Fortnite. Defaults to empty string (recommended).
party_version
int
default:"3"
The party version to use. Determines party compatibility.
default_party_config
DefaultPartyConfig
The default configuration used when creating parties.
default_party_member_config
DefaultPartyMemberConfig
The default party member configuration.
http_retry_config
HTTPRetryConfig
Configuration for HTTP retries.
build
str
default:"++Fortnite+Release-38.10-CL-47888945"
The Fortnite build version string.
os
str
default:"Windows/10.0.19045.1.768.64bit"
The OS version string for the user agent.
service_host
str
default:"prod.ol.epicgames.com"
The host for Fortnite’s XMPP services.
service_domain
str
default:"xmpp-service-prod.ol.epicgames.com"
The domain for Fortnite’s XMPP services.
service_port
int
default:"5222"
The port for Fortnite’s XMPP services.
cache_users
bool
default:"True"
Whether to cache User objects. Disable for programs with many users.
kill_other_sessions
bool
default:"True"
Whether to kill other existing sessions on login.
fetch_user_data_in_events
bool
default:"True"
Whether to fetch user data during event processing. Disabling may help with rate limits but some user attributes may be None.
wait_for_member_meta_in_events
bool
default:"True"
Whether to wait for party member metadata before dispatching events.
leave_party_at_shutdown
bool
default:"True"
Whether to leave the current party on shutdown.

Attributes

user
ClientUser
The user the client is logged in as.
party
ClientParty
The party the client is currently connected to.
friends
List[Friend]
List of the client’s friends.
friend_count
int
The number of friends the client has.
pending_friends
List[Union[IncomingPendingFriend, OutgoingPendingFriend]]
List of all pending friend requests (incoming and outgoing).
pending_friend_count
int
The total number of pending friends.
incoming_pending_friends
List[IncomingPendingFriend]
List of incoming pending friend requests.
incoming_pending_friend_count
int
The number of incoming pending friend requests.
outgoing_pending_friends
List[OutgoingPendingFriend]
List of outgoing pending friend requests.
outgoing_pending_friend_count
int
The number of outgoing pending friend requests.
blocked_users
List[BlockedUser]
List of blocked users.
blocked_user_count
int
The number of blocked users.
presences
List[Presence]
List of last presences from currently online friends.

Methods

run

client.run()
Starts the event loop and runs the client. This is a blocking method and should be the last function called.
This method handles KeyboardInterrupt gracefully and closes the client automatically.
Raises:
  • AuthException - Invalid credentials or authentication failure
  • HTTPException - Request error during login

start

await client.start(dispatch_ready: bool = True)
Starts the client and logs in. Can be used as a coroutine or async context manager.
dispatch_ready
bool
default:"True"
Whether to dispatch the ready event when ready.
Usage as context manager:
async with client.start():
    user = await client.fetch_user('Ninja')
    print(user.display_name)
Usage with await:
async with client.start() as future:
    user = await client.fetch_user('Ninja')
    await future  # Runs forever
Raises:
  • AuthException - Invalid credentials or authentication failure
  • HTTPException - Request error during login

close

await client.close(
    close_http: bool = True,
    dispatch_close: bool = True
)
Logs out and closes running services.
close_http
bool
default:"True"
Whether to close the HTTP client session.
dispatch_close
bool
default:"True"
Whether to dispatch the close event.
Raises:
  • HTTPException - Error during logout

join_party

await client.join_party(party_id: str) -> ClientParty
Joins a party by its ID.
party_id
str
required
The ID of the party to join.
return
ClientParty
The party that was joined.
Raises:
  • PartyError - Already a member of this party
  • NotFound - Party not found
  • PartyIsFull - Party is full
  • Forbidden - Not allowed to join (private or kicked)
  • HTTPException - Request error
The client leaves its current party before joining. If an error occurs, a new party is created.

set_presence

client.set_presence(
    status: str,
    away: AwayStatus = AwayStatus.ONLINE
)
Sets the client’s presence status. Overrides party presence status.
status
str
required
The status message to set.
away
AwayStatus
default:"AwayStatus.ONLINE"
The away status to use.
Raises:
  • TypeError - Status is not a string

accept_friend

await client.accept_friend(user_id: str) -> Friend
Accepts a friend request.
user_id
str
required
The ID of the user to accept.
return
Friend
The newly added friend.
Do not use this method to send friend requests. Use add_friend() instead.
Raises:
  • NotFound - User does not exist
  • DuplicateFriendship - Already friends
  • FriendshipRequestAlreadySent - Request already sent
  • Forbidden - Not allowed due to user settings
  • HTTPException - Request error

get_friend

client.get_friend(user_id: str) -> Optional[Friend]
Gets a friend from cache by user ID.
user_id
str
required
The ID of the friend.
return
Optional[Friend]
The friend if found, else None.

get_pending_friend

client.get_pending_friend(user_id: str) -> Optional[Union[IncomingPendingFriend, OutgoingPendingFriend]]
Gets a pending friend from cache by user ID.
user_id
str
required
The ID of the pending friend.
return
Optional[Union[IncomingPendingFriend, OutgoingPendingFriend]]
The pending friend if found, else None.

get_incoming_pending_friend

client.get_incoming_pending_friend(user_id: str) -> Optional[IncomingPendingFriend]
Gets an incoming pending friend from cache by user ID.
user_id
str
required
The ID of the incoming pending friend.
return
Optional[IncomingPendingFriend]
The incoming pending friend if found, else None.

get_outgoing_pending_friend

client.get_outgoing_pending_friend(user_id: str) -> Optional[OutgoingPendingFriend]
Gets an outgoing pending friend from cache by user ID.
user_id
str
required
The ID of the outgoing pending friend.
return
Optional[OutgoingPendingFriend]
The outgoing pending friend if found, else None.

get_blocked_user

client.get_blocked_user(user_id: str) -> Optional[BlockedUser]
Gets a blocked user from cache by user ID.
user_id
str
required
The ID of the blocked user.
return
Optional[BlockedUser]
The blocked user if found, else None.

get_presence

client.get_presence(user_id: str) -> Optional[Presence]
Gets the latest presence from cache for a friend.
user_id
str
required
The ID of the friend.
return
Optional[Presence]
The presence if found, else None.

has_friend

client.has_friend(user_id: str) -> bool
Checks if the client is friends with a user.
user_id
str
required
The ID of the user to check.
return
bool
True if friends, else False.

is_pending

client.is_pending(user_id: str) -> bool
Checks if a user is a pending friend.
user_id
str
required
The ID of the user to check.
return
bool
True if pending friend, else False.

is_blocked

client.is_blocked(user_id: str) -> bool
Checks if a user is blocked.
user_id
str
required
The ID of the user to check.
return
bool
True if blocked, else False.

Inherited Methods

The Client class inherits all methods from BasicClient, including:
  • User fetching methods (fetch_user, fetch_users, etc.)
  • Stats methods (fetch_br_stats, fetch_ranked_stats, etc.)
  • Friend management (add_friend, remove_or_decline_friend, etc.)
  • Block management (block_user, unblock_user, fetch_blocklist)
  • Event handling (event, wait_for, add_event_handler, etc.)
  • Store and news methods (fetch_item_shop, fetch_br_news, etc.)
See BasicClient for complete documentation of inherited methods.

Example

import rebootpy

client = rebootpy.Client(
    auth=rebootpy.DeviceAuth(
        device_id='your_device_id',
        account_id='your_account_id',
        secret='your_secret'
    )
)

@client.event
async def event_ready():
    print(f'Logged in as {client.user.display_name}')
    print(f'Friends: {client.friend_count}')

@client.event
async def event_friend_request(request):
    await request.accept()
    print(f'Accepted friend request from {request.display_name}')

@client.event
async def event_party_invitation(invitation):
    await invitation.accept()
    print(f'Joined party from {invitation.sender.display_name}')

client.run()

Build docs developers (and LLMs) love