API Reference

Authentication

The preferred method to login is DeviceAuth. To set up and handle this type of auth, you should use AdvancedAuth. This example demonstrates how you can set up this auth with file storage for the preferred login which is DeviceAuth.

class rebootpy.AdvancedAuth(exchange_code=None, authorization_code=None, device_id=None, account_id=None, secret=None, prompt_exchange_code=False, prompt_authorization_code=False, prompt_device_code=True, open_link_in_browser=True, prompt_code_if_invalid=False, prompt_code_if_throttled=False, delete_existing_device_auths=False, **kwargs)[source]

Authenticates by the available data in the following order:

1. By DeviceAuth if device_id, account_id and secret are present.

2. DeviceCodeAuth is tried if prompt_device_code is True.

3. ExchangeCodeAuth is tried if exchange_code is present or if prompt_exchange_code is True.

4. AuthorizationCodeAuth is tried if authorization_code is present or if prompt_authorization_code is True.

If the authentication was not done by step 1, a device auth is automatically generated and the details will be dispatched to event_device_auth_generate(). It is important to store these values somewhere since they can be used for easier logins.

If you’d like to deal with the device code link yourself instead of it being printed to console, you can use event_device_code_generated().

Parameters:
  • exchange_code (Optional[Union[str, Callable, Awaitable]]) – The exchange code or a function/coroutine that when called returns the exchange code.

  • authorization_code (Optional[Union[str, Callable, Awaitable]]) – The authorization code or a function/coroutine that when called returns the authorization code.

  • device_id (Optional[str]) – The device id to use for the login.

  • account_id (Optional[str]) – The account id to use for the login.

  • secret (Optional[str]) – The secret to use for the login.

  • prompt_device_code (bool) –

    If this is set to True and no exchange code is passed, you will be prompted to enter the exchange code in the console if needed.

    Note

    Both prompt_exchange_code and prompt_authorization_code cannot be True at the same time.

  • prompt_exchange_code (bool) –

    If this is set to True and no exchange code is passed, you will be prompted to enter the exchange code in the console if needed.

    Note

    Both prompt_exchange_code and prompt_authorization_code cannot be True at the same time.

  • prompt_authorization_code (bool) –

    If this is set to True and no authorization code is passed, you will be prompted to enter the authorization code in the console if needed.

    Note

    Both prompt_exchange_code and prompt_authorization_code cannot be True at the same time.

  • prompt_code_if_invalid (bool) –

    Whether or not to prompt a code if the device auth details was invalid. If this is False then the regular AuthException is raised instead.

    Note

    This only works if prompt_exchange_code or prompt_authorization_code is True.

  • prompt_code_if_throttled (bool) –

    If this is set to True and you receive a throttling response, you will be prompted to enter a code in the console.

    Note

    This only works if prompt_exchange_code or prompt_authorization_code is True.

  • delete_existing_device_auths (bool) – Whether or not to delete all existing device auths when a new is created.

  • ios_token (Optional[str]) – The main Fortnite token to use with authentication. You should generally not need to set this manually.

authorization

The Authorization header for use with Fortnite endpoints, use this if you’re making HTTP requests that aren’t already implemented.

Type:

str

class rebootpy.DeviceCodeAuth(open_link_in_browser=True, **kwargs)[source]

Authenticate with device code.

If you’d like to deal with the device code link yourself instead of it being printed to console, you can use event_device_code_generated().

Parameters:
  • open_link_in_browser (bool) – Whether or not to automatically open the Epic Games login in the default browser.

  • ios_token (Optional[str]) – The main Fortnite token to use with authentication. You should generally not need to set this manually.

  • switch_token (Optional[str]) – The switch token to use with authentication. You should generally not need to set this manually.

authorization

The Authorization header for use with Fortnite endpoints, use this if you’re making HTTP requests that aren’t already implemented.

Type:

str

class rebootpy.DeviceAuth(device_id, account_id, secret, **kwargs)[source]

Authenticate with device auth details.

Note

When an account’s password is reset, all device authentications associated with the account are removed. If your device ID and secret are compromised, resetting your password will invalidate all authentication data, making it useless to anyone who may have accessed the leaked data.

Parameters:
  • device_id (str) – The device id.

  • account_id (str) – The account’s id.

  • secret (str) – The secret.

  • ios_token (Optional[str]) – The main Fortnite token to use with authentication. You should generally not need to set this manually.

authorization

The Authorization header for use with Fortnite endpoints, use this if you’re making HTTP requests that aren’t already implemented.

Type:

str

class rebootpy.AuthorizationCodeAuth(code, **kwargs)[source]

Authenticates by exchange code.

You can get the code from here by logging in and copying the code from the redirectUrl’s query parameters. If you are already logged in and want to change accounts, simply log out at https://www.epicgames.com, log in to the new account and then enter the link above again to generate an authorization code.

How to get an authorization code:

https://raw.githubusercontent.com/xMistt/rebootpy/main/docs/resources/images/authorization_code.png

Note

An authorization code only works for a single login within a short timeframe (300 seconds). Therefore you need to get a new code for each login. You can get a new code by refreshing the site.

Parameters:
  • code (Union[str, Callable, Awaitable]) – The authorization code or a function/coroutine that when called returns the authorization code.

  • device_id (Optional[str]) – A 32 char hex string representing your device.

  • ios_token (Optional[str]) – The main Fortnite token to use with authentication. You should generally not need to set this manually.

authorization

The Authorization header for use with Fortnite endpoints, use this if you’re making HTTP requests that aren’t already implemented.

Type:

str

class rebootpy.ExchangeCodeAuth(code, **kwargs)[source]

Authenticates by an exchange code.

Note

The method to get an exchange code has been significantly harder since epic patched the old method of copying the code from one of their own endpoints that could be requested easily in a browser. To obtain an exchange code it is recommended to provide a custom solution like running a selenium process where you log in on https://epicgames.com and then redirect to /id/api/exchange/generate. You can then return the exchange code. You can put this solution in a function and then pass this to exchange_code.

Note

An exchange code only works for a single login within a short timeframe (300 seconds). Therefore you need to get a new code for each login. You can get a new code by refreshing the site.

Parameters:
  • code (Union[str, Callable, Awaitable]) – The exchange code or a function/coroutine that when called returns the exchange code.

  • device_id (Optional[str]) – A 32 char hex string representing your device.

  • ios_token (Optional[str]) – The main Fortnite token to use with authentication. You should generally not need to set this manually.

authorization

The Authorization header for use with Fortnite endpoints, use this if you’re making HTTP requests that aren’t already implemented.

Type:

str

class rebootpy.RefreshTokenAuth(refresh_token, **kwargs)[source]

Authenticates by the passed launcher refresh token.

Parameters:

refresh_token (str) – A valid launcher refresh token.

authorization

The Authorization header for use with Fortnite endpoints, use this if you’re making HTTP requests that aren’t already implemented.

Type:

str

Clients

BasicClient

class rebootpy.BasicClient[source]

Represents a basic stripped down version of Client. You might want to use this client if your only goal is to make simple requests like user or stats fetching.

This client does not support the following:
Supported events by this client:
Parameters:
  • auth (Auth) – The authentication method to use. You can read more about available authentication methods here.

  • http_connector (aiohttp.BaseConnector) – The connector to use for http connection pooling.

  • http_retry_config (Optional[HTTPRetryConfig]) – The config to use for http retries.

  • build (str) – The build used by Fortnite. Defaults to a valid but maybe outdated value.

  • os (str) – The os version string to use in the user agent. Defaults to Windows/10.0.17134.1.768.64bit which is valid no matter which platform you have set.

  • cache_users (bool) – Whether or not the library should cache User objects. Disable this if you are running a program with lots of users as this could potentially take a big hit on the memory usage. Defaults to True.

  • kill_other_sessions (bool) – Whether or not the library should kill all other existing session/ tokens, you only need this if you’re running a rebootpy client alongside an actual Fortnite session. Defaults to True.

user

The user the client is logged in as.

Type:

ClientUser

register_connectors(http_connector=None)[source]

This can be used to register a http connector after the client has already been initialized. It must however be called before start() has been called, or in event_before_start().

Warning

Connectors passed will not be closed on shutdown. You must close them yourself if you want a graceful shutdown.

Parameters:

http_connector (aiohttp.BaseConnector) – The connector to use for the http session.

run()[source]

This function starts the loop and then calls start() for you. If your program already has an asyncio loop setup, you should use start() instead.

Warning

This function is blocking and should be the last function to run.

Raises:
  • AuthException – Raised if invalid credentials in any form was passed or some other misc failure.

  • HTTPException – A request error occurred while logging in.

start(dispatch_ready=True)[source]

This function is a coroutine.

Starts the client and logs into the specified user.

This method can be used as a coroutine or an async context manager, depending on your needs.

How to use as an async context manager: ::
async with client.start():

user = await client.fetch_user(‘Ninja’) print(user.display_name)

If you want to use it as an async context manager, but also keep the client running forever, you can await the return of start like this:

async with client.start() as future:
    user = await client.fetch_user('Ninja')
    print(user.display_name)

    await future  # Nothing after this line will run.

Warning

This method is blocking if you await it as a coroutine or you await the return future. This means that no code coming after will run until the client is closed. When the client is ready it will dispatch event_ready().

Parameters:

dispatch_ready (bool) – Whether or not the client should dispatch the ready event when ready.

Raises:
  • AuthException – Raised if invalid credentials in any form was passed or some other misc failure.

  • HTTPException – A request error occurred while logging in.

async close(*, close_http=True, dispatch_close=True)[source]

This function is a coroutine.

Logs the user out and closes running services.

Parameters:
  • close_http (bool) – Whether or not to close the clients aiohttp.ClientSession when logged out.

  • dispatch_close (bool) – Whether or not to dispatch the close event.

Raises:

HTTPException – An error occurred while logging out.

is_closed()[source]

bool: Whether the client is running or not.

async restart()[source]

This function is a coroutine.

Restarts the client completely. All events received while this method runs are dispatched when it has finished.

Raises:
  • AuthException – Raised if invalid credentials in any form was passed or some other misc failure.

  • HTTPException – A request error occurred while logging in.

is_ready()[source]

Specifies if the internal state of the client is ready.

Returns:

True if the internal state is ready else False

Return type:

bool

async wait_until_ready()[source]

This function is a coroutine.

Waits until the internal state of the client is ready.

async wait_until_closed()[source]

This function is a coroutine.

Waits until the client is fully closed.

async fetch_user_by_display_name(display_name, *, cache=False, raw=False)[source]

This function is a coroutine.

Fetches a user from the passed display name.

Parameters:
  • display_name (str) – The display name of the user you want to fetch the user for.

  • cache (bool) –

    If set to True it will try to get the user from the friends or user cache.

    Note

    Setting this parameter to False will make it an api call.

  • raw (bool) –

    If set to True it will return the data as you would get it from the api request.

    Note

    Setting raw to True does not work with cache set to True.

Raises:

HTTPException – An error occurred while requesting the user.

Returns:

The user requested. If not found it will return None.

Return type:

Optional[User]

async fetch_users_by_display_name(display_name, *, raw=False)[source]

This function is a coroutine.

Fetches all users including external users (accounts from other platforms) that matches the given the display name.

Warning

This function is not for requesting multiple users by multiple display names. Use BasicClient.fetch_user() for that.

Parameters:
  • display_name (str) – The display name of the users you want to get.

  • raw (bool) – If set to True it will return the data as you would get it from the api request. Defaults to ``False``

Raises:

HTTPException – An error occurred while requesting the user.

Returns:

A list containing all payloads found for this user.

Return type:

List[User]

async fetch_user(user, *, cache=False, raw=False)[source]

This function is a coroutine.

Fetches a single user by the given id/displayname.

Parameters:
  • user (str) – Id or display name

  • cache (bool) –

    If set to True it will try to get the user from the friends or user cache and fall back to an api request if not found.

    Note

    Setting this parameter to False will make it an api call.

  • raw (bool) –

    If set to True it will return the data as you would get it from the api request.

    Note

    Setting raw to True does not work with cache set to True.

Raises:

HTTPException – An error occurred while requesting the user.

Returns:

The user requested. If not found it will return None

Return type:

Optional[User]

async fetch_users(users, *, cache=False, raw=False)[source]

This function is a coroutine.

Fetches multiple users at once by the given ids/displaynames.

Parameters:
  • users (Iterable[str]) – An iterable containing ids/displaynames.

  • cache (bool) –

    If set to True it will try to get the users from the friends or user cache and fall back to an api request if not found.

    Note

    Setting this parameter to False will make it an api call.

  • raw (bool) –

    If set to True it will return the data as you would get it from the api request.

    Note

    Setting raw to True does not work with cache set to True.

Raises:

HTTPException – An error occurred while requesting user information.

Returns:

Users requested. Only users that are found gets returned.

Return type:

List[User]

async search_users(prefix, platform)[source]

This function is a coroutine.

Searches after users by a prefix and returns up to 100 matches.

Parameters:
  • prefix (str) –

    The prefix you want to search by. The prefix is case insensitive.
    Example: Tfue will return Tfue’s user + up to 99 other

    users which have display names that start with or match exactly to Tfue like Tfue_Faze dequan.

  • platform (UserSearchPlatform) –

    The platform you wish to search by.

    Note

    The platform is only important for prefix matches. All exact matches are returned regardless of which platform is specified.

Raises:

HTTPException – An error occurred while requesting.

Returns:

An ordered list of users that matched the prefix.

Return type:

List[UserSearchEntry]

async fetch_avatars(users)[source]

This function is a coroutine.

Fetches the avatars of the provided user ids.

Warning

You can only fetch avatars of friends. That means that the bot has to be friends with the users you are requesting the avatars of.

Parameters:

users (List[str]) – A list containing user ids.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A dict containing avatars mapped to their user id.

Return type:

Dict[str, Avatar]

async search_sac_by_slug(slug)[source]

This function is a coroutine.

Searches for an owner of slug + retrieves owners of similar slugs.

Parameters:

slug (str) – The slug (support a creator code) you wish to search for.

Raises:

HTTPException – An error occurred while requesting fortnite’s services.

Returns:

An ordered list of users who matched the exact or slightly modified slug.

Return type:

List[SacSearchEntryUser]

get_user(user_id)[source]

Tries to get a user from the user cache by the given user id.

Parameters:

user_id (str) – The id of the user.

Returns:

The user if found, else None

Return type:

Optional[User]

async fetch_blocklist()[source]

This function is a coroutine.

Retrieves the blocklist with an api call.

Raises:

HTTPException – An error occurred while fetching blocklist.

Returns:

List of ids

Return type:

List[str]

async block_user(user_id)[source]

This function is a coroutine.

Blocks a user by a given user id.

Parameters:

user_id (str) – The id of the user you want to block.

Raises:

HTTPException – Something went wrong when trying to block this user.

async unblock_user(user_id)[source]

This function is a coroutine.

Unblocks a user by a given user id.

Parameters:

user_id (str) – The id of the user you want to unblock

Raises:

HTTPException – Something went wrong when trying to unblock this user.

async add_friend(user_id)[source]

This function is a coroutine.

Sends a friend request to the specified user id.

Parameters:

user_id (str) – The id of the user you want to add.

Raises:
  • NotFound – The specified user does not exist.

  • DuplicateFriendship – The client is already friends with this user.

  • FriendshipRequestAlreadySent – The client has already sent a friendship request that has not been handled yet by the user.

  • MaxFriendshipsExceeded – The client has hit the max amount of friendships a user can have at a time. For most accounts this limit is set to 1000 but it could be higher for others.

  • InviteeMaxFriendshipsExceeded – The user you attempted to add has hit the max amount of friendships a user can have at a time.

  • InviteeMaxFriendshipRequestsExceeded – The user you attempted to add has hit the max amount of friendship requests a user can have at a time. This is usually 700 total requests.

  • Forbidden – The client is not allowed to send friendship requests to the user because of the users settings.

  • HTTPException – An error occurred while requesting to add this friend.

async accept_friend(user_id)[source]

This function is a coroutine.

Accepts a request.

Parameters:

user_id (str) – The id of the user you want to accept.

Raises:
  • NotFound – The specified user does not exist.

  • DuplicateFriendship – The client is already friends with this user.

  • FriendshipRequestAlreadySent – The client has already sent a friendship request that has not been handled yet by the user.

  • Forbidden – The client is not allowed to send friendship requests to the user because of the users settings.

  • HTTPException – An error occurred while requesting to accept this friend.

async remove_or_decline_friend(user_id)[source]

This function is a coroutine.

Removes a friend by the given id.

Parameters:

user_id (str) – The id of the friend you want to remove.

Raises:

HTTPException – Something went wrong when trying to remove this friend.

wait_for(event, *, check=None, timeout=None)[source]

This function is a coroutine.

Waits for an event to be dispatch.

In case the event returns more than one arguments, a tuple is passed containing the arguments.

Examples

This example waits for the author of a FriendMessage to say hello.:

@client.event
async def event_friend_message(message):
    await message.reply('Say hello!')

    def check_function(m):
        return m.author.id == message.author.id

    msg = await client.wait_for('message', check=check_function, timeout=60)
    await msg.reply('Hello {0.author.display_name}!'.format(msg))

This example waits for the the leader of a party to promote the bot after joining and then sets a new custom key:

@client.event
async def event_party_member_join(member):

    # checks if the member that joined is the UserClient
    if member.id != client.user.id:
        return

    def check(m):
        return m.id == client.user.id

    try:
        await client.wait_for('party_member_promote', check=check, timeout=120)
    except asyncio.TimeoutError:
        await member.party.send('You took too long to promote me!')

    await member.party.set_custom_key('my_custom_key_123')
Parameters:
  • event (str) –

    The name of the event.

    Note

    The name of the event must be without the event_

    prefix. | | Wrong = event_friend_message. | Correct = friend_message.

  • check (Optional[Callable]) – A predicate to check what to wait for. Defaults to a predicate that always returns True. This means it will return the first result unless you pass another predicate.

  • timeout (int) – How many seconds to wait for before asyncio.TimeoutError is raised. Defaults to ``None`` which means it will wait forever.

Raises:

asyncio.TimeoutError – No event was retrieved in the time you specified.

Returns:

Returns arguments based on the event you are waiting for. An event might return no arguments, one argument or a tuple of arguments. Check the event reference <rebootpy-events-api> for more information about the returning arguments.

Return type:

Any

add_event_handler(event, coro)[source]

Registers a coroutine as an event handler. You can register as many coroutines as you want to a single event.

Parameters:
  • event (str) – The name of the event you want to register this coro for.

  • coro (coroutine) – The coroutine to function as the handler for the specified event.

Raises:

TypeError – The function passed to coro is not a coroutine.

remove_event_handler(event, coro)[source]

Removes a coroutine as an event handler.

Parameters:
  • event (str) – The name of the event you want to remove this coro for.

  • coro (coroutine) – The coroutine that already functions as a handler for the specified event.

event(event_or_coro=None)[source]

A decorator to register an event.

Note

You do not need to decorate events in a subclass of BasicClient but the function names of event handlers must follow this format event_<event>.

Usage:

@client.event
async def event_friend_message(message):
    await message.reply('Thanks for your message!')

@client.event('friend_message')
async def my_message_handler(message):
    await message.reply('Thanks for your message!')
Raises:
  • TypeError – The decorated function is not a coroutine.

  • TypeError – Event is not specified as argument or function name with event prefix.

async fetch_ranked_stats(user_id, season=None)[source]

This function is a coroutine.

Gets ranked stats of the specified user, currently this works for all users even if they have their stats set to private.

Usage:

# get my C5S3 ranked stats
async def get_6v_ranked_stats():
    print(f'Fetching ranked stats for C5S3')

    user = await bot.fetch_user('6v.')
    ranks = await bot.fetch_ranked_stats(
        user_id=user.id,
        season=rebootpy.Season.C5S3
    )

    for rank in ranks:
        print(f'{rank.ranking_type.name} - {rank.current_division.name}')

# Example output:
# Fetching ranked stats for C5S3
# BATTLE_ROYALE - DIAMOND_2
# ROCKET_RACING - UNRANKED
# ZERO_BUILD - UNREAL
Parameters:
  • user_id (str) – The id of the user you want to fetch stats for.

  • season (Optional[Season]) – The season that you want to get ranks from. If not provided, it will get the current season’s ranked tracks automatically. Defaults to None

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of all of the user’s ranks in the requested season.

Return type:

List[CompetitiveRank]

async fetch_br_stats(user_id, *, start_time=None, end_time=None)[source]

This function is a coroutine.

Gets Battle Royale stats for the specified user.

Parameters:
  • user_id (str) – The id of the user you want to fetch stats for.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the ``start_timestamp`` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the ``end_timestamp`` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden

    The user has chosen to be hidden from public stats by disabling the fortnite setting below. | Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats for this user. If the user was not found None is returned.

Return type:

StatsV2

async fetch_multiple_event_tokens(user_ids)[source]

This function is a coroutine.

Gets event tokens for the specified users.

Parameters:

user_ids (list) – A list of user ids you want to fetch event tokens for.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A dictionary with user ids mapped to a list of tokens.

Return type:

dict

async fetch_event_tokens(user_id)[source]

This function is a coroutine.

Gets event tokens for the specified user.

Parameters:

user_id (str) – The id of the user you want to fetch event tokens for.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of event tokens.

Return type:

list[str]

async fetch_multiple_flags(user_ids)[source]

This function is a coroutine.

Gets the current set flags for the specified users.

Parameters:

user_ids (str) – A list of user ids you want to fetch flags for.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A dictionary with user ids mapped to a flag enum.

Return type:

dict[str, Country | None]

async fetch_flag(user_id)[source]

This function is a coroutine.

Gets current set flag for the specified user.

Parameters:

user_id (str) – The id of the user you want to fetch the flag for.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The users flag.

Return type:

Country | None

async fetch_multiple_br_stats(user_ids, stats, *, start_time=None, end_time=None)[source]

This function is a coroutine.

Gets Battle Royale stats for multiple users at the same time.

Note

This function is not the same as doing fetch_br_stats() for multiple users. The expected return for this function would not be all the stats for the specified users but rather the stats you specify.

Example usage:

async def stat_function():
    stats = [
        rebootpy.StatsV2.create_stat('placetop1', rebootpy.V2Input.KEYBOARDANDMOUSE, 'defaultsolo'),
        rebootpy.StatsV2.create_stat('kills', rebootpy.V2Input.KEYBOARDANDMOUSE, 'defaultsolo'),
        rebootpy.StatsV2.create_stat('matchesplayed', rebootpy.V2Input.KEYBOARDANDMOUSE, 'defaultsolo')
    ]

    users = await self.fetch_users(['SypherPK', 'CouRageJD'])
    user_ids = [u.id for u in users]

    data = await self.fetch_multiple_br_stats(user_ids=user_ids, stats=stats)
    for id, res in data.items():
        if res is not None:
            print('ID: {0} | Stats: {1}'.format(id, res.get_stats()))
        else:
            print('ID: {0} not found.')

# Example output:
# ID: 463ca9d604524ce38071f512baa9cd70 | Stats: {'keyboardmouse': {'defaultsolo': {'wins': 759, 'kills': 28093, 'matchesplayed': 6438}}}
# ID: 3900c5958e4b4553907b2b32e86e03f8 | Stats: {'keyboardmouse': {'defaultsolo': {'wins': 1763, 'kills': 41375, 'matchesplayed': 7944}}}
# ID: NonValidUserIdForTesting not found.
Parameters:
  • user_ids (List[str]) – A list of ids you are requesting the stats for.

  • stats (List[str]) –

    A list of stats to get for the users. Use StatsV2.create_stat() to create the stats.

    Example:

    [
        rebootpy.StatsV2.create_stat('placetop1', rebootpy.V2Input.KEYBOARDANDMOUSE, 'defaultsolo'),
        rebootpy.StatsV2.create_stat('kills', rebootpy.V2Input.KEYBOARDANDMOUSE, 'defaultsolo'),
        rebootpy.StatsV2.create_stat('matchesplayed', rebootpy.V2Input.KEYBOARDANDMOUSE, 'defaultsolo')
    ]
    

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A mapping where StatsV2 is bound to its owners id. If a userid was not found then the value bound to that userid will be None.

Note

If a users stats is missing in the returned mapping it means that the user has opted out of public leaderboards and that the client therefore does not have permissions to request their stats.

Return type:

Dict[str, Optional[StatsV2]]

async fetch_multiple_br_stats_collections(user_ids, collection=None, *, start_time=None, end_time=None)[source]

This function is a coroutine.

Gets Battle Royale stats collections for multiple users at the same time.

Parameters:
  • user_ids (List[str]) – A list of ids you are requesting the stats for.

  • collection (StatsCollectionType) – The collection to receive. Collections are predefined stats that it attempts to request.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A mapping where StatsCollection is bound to its owner’s id. If a userid was not found then the value bound to that userid will be None.

Note

If a user’s stats are missing in the returned mapping, it means that the user has opted out of public leaderboards and that the client therefore does not have permissions to request their stats.

Return type:

Dict[str, Optional[StatsCollection]]

async fetch_multiple_battlepass_levels(users, season, *, start_time=None, end_time=None)[source]

This function is a coroutine.

Fetches multiple users’ battlepass level.

Parameters:
  • users (List[str]) – List of user ids.

  • season (Season) – The season enum to request the battlepass levels for.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the window to get the battlepass level from. Must be seconds since epoch or a datetime.datetime instance. Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the window to get the battlepass level from. Must be seconds since epoch or a datetime.datetime instance. Defaults to None.

Raises:
  • ValueError – If end_time is earlier than the season’s start timestamp.

  • HTTPException – An error occurred while requesting.

Returns:

Users’ battlepass level mapped to their account id. Returns None if no battlepass level was found. If a user has career board set to private, they will not appear in the result. Therefore you should never expect a user to be included.

Note

The decimals are the percent progress to the next level. E.g. 208.63 -> Level 208 and 63% on the way to 209.

Note

If a user’s battlepass level is missing in the returned mapping, it means that the user has opted out of public leaderboards and that the client therefore does not have permission to request their stats.

Return type:

Dict[str, Optional[float]]

async fetch_battlepass_level(user_id, *, season, start_time=None, end_time=None)[source]

This function is a coroutine.

Fetches a user’s battlepass level.

Parameters:
  • user_id (str) – The user id to fetch the battlepass level for.

  • season (Season) –

    The season enum to request the battlepass level for.

    Warning

    If you are requesting the previous season and the new season has not been added to the library yet (check SeasonStartTimestamp), you have to manually include the previous season’s end timestamp in epoch seconds.

  • start_time (Optional[Union[int, datetime.datetime]) – The UTC start time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime` or the ``start_timestamp`` value of a :class:`Season` e.g. `Season.C5SOG.start_timestamp` Defaults to None

  • end_time (Optional[Union[int, datetime.datetime]) – The UTC end time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime` or the ``start_timestamp`` value of a :class:`Season` e.g. `Season.C5SOG.start_timestamp` Defaults to None

Raises:
Returns:

The user’s battlepass level. None is returned if the user has not played any real matches this season.

Note

The decimals are the percent progress to the next level. E.g. 208.63 -> Level 208 and 63% on the way to 209.

Return type:

Optional[float]

async fetch_leaderboard(stat)[source]

This function is a coroutine.

Fetches the leaderboard for a stat.

Warning

For some weird reason, the only valid stat you can pass is one with placetop1 (wins is also accepted).

Example usage:

async def get_leaderboard():
    stat = rebootpy.StatsV2.create_stat(
        'wins',
        rebootpy.V2Input.KEYBOARDANDMOUSE,
        'defaultsquad'
    )

    data = await client.fetch_leaderboard(stat)

    for placement, entry in enumerate(data):
        print('[{0}] Id: {1} | Wins: {2}'.format(
            placement, entry['account'], entry['value']))
Parameters:

stat (str) – The stat you are requesting the leaderboard entries for. You can use StatsV2.create_stat() to create this string.

Raises:
  • ValueError – You passed an invalid/non-accepted stat argument.

  • HTTPException – An error occurred when requesting.

Returns:

List of dictionaries containing entry data. Example return:

{
    'account': '4480a7397f824fe4b407077fb9397fbb',
    'value': 5082
}

Return type:

List[Dict[str, Union[str, int]]]

async fetch_party(party_id)[source]

This function is a coroutine.

Fetches a party by its id.

Parameters:

party_id (str) – The id of the party.

Raises:

Forbidden – You are not allowed to look up this party.

Returns:

The party that was fetched. None if not found.

Return type:

Optional[Party]

async fetch_lightswitch_status(service_id='Fortnite')[source]

This function is a coroutine.

Fetches the lightswitch status of an epicgames service.

Parameters:

service_id (str) – The service id to check status for.

Raises:
  • ValueError – The returned data was empty. Most likely because service_id is not valid.

  • HTTPException – An error occurred when requesting.

Returns:

True if service is up else False

Return type:

bool

async fetch_item_shop()[source]

This function is a coroutine.

Fetches the current item shop.

Example:

# fetches all CIDs (character ids) of of the current item shop.
async def get_current_item_shop_cids():
    store = await client.fetch_item_shop()

    cids = []
    for item in store.featured_items + store.daily_items:
        for grant in item.grants:
            if grant['type'] == 'AthenaCharacter':
                cids.append(grant['asset'])

    return cids
Raises:

HTTPException – An error occurred when requesting.

Returns:

Object representing the data from the current item shop.

Return type:

Store

async fetch_br_news()[source]

This function is a coroutine.

Fetches news for the Battle Royale gamemode.

Note

News is now specific to the player, most players who play regularly may get 1 or 2 different news posts to an account that has either never played or hasnt played in a while.

Raises:

HTTPException – An error occurred when requesting.

Returns:

List[BattleRoyaleNewsPost]

Return type:

list

async fetch_br_playlists()[source]

This function is a coroutine.

Fetches all playlists registered on Fortnite. This includes all previous gamemodes that is no longer active.

Raises:

HTTPException – An error occurred while requesting.

Returns:

List containing all playlists registered on Fortnite.

Return type:

List[Playlist]

async fetch_active_ltms(region)[source]

This function is a coroutine.

Fetches active LTMs for a specific region.

Parameters:

region (Region) – The region to request active LTMs for.

Raises:

HTTPException – An error occurred while requesting.

Returns:

List of internal playlist names. Returns an empty list of none LTMs are for the specified region.

Return type:

List[str]

async fetch_creative_island(code)[source]

This function is a coroutine.

Fetches a creative island or playlist by its code.

Parameters:

code (str) – Either the island code or playlist ID.

Raises:

HTTPException – An error occurred while requesting.

Returns:

Object representing the data of the creative island/playlist.

Return type:

CreativeIsland

Client

class rebootpy.Client[source]

Represents the client connected to Fortnite and EpicGames’ services.

Parameters:
  • auth (Auth) – The authentication method to use. You can read more about available authentication methods here.

  • http_connector (aiohttp.BaseConnector) – The connector to use for http connection pooling.

  • ws_connector (aiohttp.BaseConnector) – The connector to use for websocket connection pooling. This could be the same as the above connector.

  • status (str) –

    The status you want the client to send with its presence to friends. Defaults to: {current_playlist}.

    Note

    There are 3 variables you can use in status, you can also use these later on if you set status past initalisation.

    • {party_size} - Amount of players in the party.

    • {party_max_size} - Max size of the party.

    • {current_playlist} - Uses the same formatting as the normal client e.g. Battle Royale.

  • away (AwayStatus) – The away status the client should use for its presence. Defaults to AwayStatus.ONLINE.

  • platform (Platform) – The platform you want the client to display as its source. Defaults to Platform.WINDOWS.

  • net_cl (str) – The current net cl used by the current Fortnite build. Named netCL in official logs. Defaults to an empty string which is the recommended usage as of v0.9.0 since you then won’t need to update it when a new update is pushed by Fortnite.

  • party_version (int) – The party version the client should use. This value determines which version should be able to join the party. If a user attempts to join the clients party with a different party version than the client, then an error will be visible saying something by the lines of “Their party of Fortnite is older/newer than yours”. If you experience this error I recommend incrementing the default set value by one since the library in that case most likely has yet to be updated. Defaults to 3 (As of November 3rd 2020).

  • default_party_config (DefaultPartyConfig) – The party configuration used when creating parties. If not specified, the client will use the default values specified in the data class.

  • default_party_member_config (DefaultPartyMemberConfig) – The party member configuration used when creating parties. If not specified, the client will use the default values specified in the data class.

  • http_retry_config (Optional[HTTPRetryConfig]) – The config to use for http retries.

  • build (str) – The build used by Fortnite. Defaults to a valid but maybe outdated value.

  • os (str) – The os version string to use in the user agent. Defaults to Windows/10.0.17134.1.768.64bit which is valid no matter which platform you have set.

  • service_host (str) – The host used by Fortnite’s XMPP services.

  • service_domain (str) – The domain used by Fortnite’s XMPP services.

  • service_port (int) – The port used by Fortnite’s XMPP services.

  • cache_users (bool) – Whether or not the library should cache User objects. Disable this if you are running a program with lots of users as this could potentially take a big hit on the memory usage. Defaults to True.

  • kill_other_sessions (bool) – Whether or not the library should kill all other existing session/ tokens, you only need this if you’re running a rebootpy client alongside an actual Fortnite session. Defaults to True.

  • fetch_user_data_in_events (bool) –

    Whether or not user data should be fetched in event processing. Disabling this might be useful for larger applications that deals with possibly being rate limited on their ip. Defaults to True.

    Warning

    Keep in mind that if this option is disabled, there is a big chance that display names, external auths and more might be missing or simply is None on objects deriving from User. Keep in mind that User.id always will be available. You can use User.fetch() to update all missing attributes.

  • wait_for_member_meta_in_events (bool) – Whether or not the client should wait for party member meta (information about outfit, backpack etc.) before dispatching events like event_party_member_join(). If this is disabled then member objects in the events won’t have the correct meta. Defaults to True.

  • leave_party_at_shutdown (bool) – Whether or not the client should leave its current party at shutdown. If this is set to false, then the client will attempt to reconnect to the party on a startup. If DefaultPartyMemberConfig.offline_ttl is exceeded before a reconnect is attempted, then the client will create a new party at startup.

user

The user the client is logged in as.

Type:

ClientUser

party

The party the client is currently connected to.

Type:

ClientParty

register_connectors(http_connector=None, ws_connector=None)[source]

This can be used to register connectors after the client has already been initialized. It must however be called before start() has been called, or in event_before_start().

Warning

Connectors passed will not be closed on shutdown. You must close them yourself if you want a graceful shutdown.

Parameters:
property friends

A list of the clients friends.

Type:

List[Friend]

property friend_count

The amount of friends the bot currently has.

Type:

int

property pending_friends

List[Union[IncomingPendingFriend, OutgoingPendingFriend]]: A list of all of the clients pending friends.

Note

Pending friends can be both incoming (pending friend sent the request to the bot) or outgoing (the bot sent the request to the pending friend). You must check what kind of pending friend an object is by their attributes incoming or outgoing.

property pending_friend_count

The amount of pending friends the bot currently has.

Type:

int

property incoming_pending_friends

A list of the clients incoming pending friends.

Type:

List[IncomingPendingFriend]

property incoming_pending_friend_count

The amount of active incoming pending friends the bot currently has received.

Type:

int

property outgoing_pending_friends

A list of the clients outgoing pending friends.

Type:

List[OutgoingPendingFriend]

property outgoing_pending_friend_count

The amount of active outgoing pending friends the bot has sent.

Type:

int

property blocked_users

A list of the users client has as blocked.

Type:

List[BlockedUser]

property blocked_user_count

The amount of blocked users the bot currently has blocked.

Type:

int

property presences

A list of the last presences from currently online friends.

Type:

List[Presence]

get_user(user_id)[source]

Tries to get a user from the user cache by the given user id.

Parameters:

user_id (str) – The id of the user.

Returns:

The user if found, else None

Return type:

Optional[User]

get_friend(user_id)[source]

Tries to get a friend from the friend cache by the given user id.

Parameters:

user_id (str) – The id of the friend.

Returns:

The friend if found, else None

Return type:

Optional[Friend]

get_pending_friend(user_id)[source]

Tries to get a pending friend from the pending friend cache by the given user id.

Parameters:

user_id (str) – The id of the pending friend.

Returns:

get_incoming_pending_friend(user_id)[source]

Tries to get an incoming pending friend from the pending friends cache by the given user id.

Parameters:

user_id (str) – The id of the incoming pending friend.

Returns:

The incoming pending friend if found, else None.

Return type:

Optional[IncomingPendingFriend]

get_outgoing_pending_friend(user_id)[source]

Tries to get an outgoing pending friend from the pending friends cache by the given user id.

Parameters:

user_id (str) – The id of the outgoing pending friend.

Returns:

The outgoing pending friend if found, else None.

Return type:

Optional[OutgoingPendingFriend]

get_blocked_user(user_id)[source]

Tries to get a blocked user from the blocked users cache by the given user id.

Parameters:

user_id (str) – The id of the blocked user.

Returns:

The blocked user if found, else None

Return type:

Optional[BlockedUser]

get_presence(user_id)[source]

Tries to get the latest received presence from the presence cache.

Parameters:

user_id (str) – The id of the friend you want the last presence of.

Returns:

The presence if found, else None

Return type:

Optional[Presence]

has_friend(user_id)[source]

Checks if the client is friends with the given user id.

Parameters:

user_id (str) – The id of the user you want to check.

Returns:

True if user is friends with the client else False

Return type:

bool

is_pending(user_id)[source]

Checks if the given user id is a pending friend of the client.

Parameters:

user_id (str) – The id of the user you want to check.

Returns:

True if user is a pending friend else False

Return type:

bool

is_blocked(user_id)[source]

Checks if the given user id is blocked by the client.

Parameters:

user_id (str) – The id of the user you want to check.

Returns:

True if user is blocked else False

Return type:

bool

async accept_friend(user_id)[source]

This function is a coroutine.

Warning

Do not use this method to send a friend request. It will then not return until the friend request has been accepted by the user.

Accepts a request.

Parameters:

user_id (str) – The id of the user you want to accept.

Raises:
  • NotFound – The specified user does not exist.

  • DuplicateFriendship – The client is already friends with this user.

  • FriendshipRequestAlreadySent – The client has already sent a friendship request that has not been handled yet by the user.

  • Forbidden – The client is not allowed to send friendship requests to the user because of the users settings.

  • HTTPException – An error occurred while requesting to accept this friend.

Returns:

Object of the friend you just added.

Return type:

Friend

async join_party(party_id)[source]

This function is a coroutine.

Joins a party by the party id.

Parameters:

party_id (str) – The id of the party you wish to join.

Raises:
  • .. warning:: – Because the client has to leave its current party before joining a new one, a new party is created if some of these errors are raised. Most of the time though this is not the case and the client will remain in its current party.

  • PartyError – You are already a member of this party.

  • NotFound – The party was not found.

  • PartyIsFull – The party you attempted to join is full.

  • Forbidden – You are not allowed to join this party because it’s private and you have not been a part of it before. .. note:: If you have been a part of the party before but got kicked, you are ineligible to join this party and this error is raised.

  • HTTPException – An error occurred when requesting to join the party.

Returns:

The party that was just joined.

Return type:

ClientParty

add_event_handler(event, coro)

Registers a coroutine as an event handler. You can register as many coroutines as you want to a single event.

Parameters:
  • event (str) – The name of the event you want to register this coro for.

  • coro (coroutine) – The coroutine to function as the handler for the specified event.

Raises:

TypeError – The function passed to coro is not a coroutine.

async add_friend(user_id)

This function is a coroutine.

Sends a friend request to the specified user id.

Parameters:

user_id (str) – The id of the user you want to add.

Raises:
  • NotFound – The specified user does not exist.

  • DuplicateFriendship – The client is already friends with this user.

  • FriendshipRequestAlreadySent – The client has already sent a friendship request that has not been handled yet by the user.

  • MaxFriendshipsExceeded – The client has hit the max amount of friendships a user can have at a time. For most accounts this limit is set to 1000 but it could be higher for others.

  • InviteeMaxFriendshipsExceeded – The user you attempted to add has hit the max amount of friendships a user can have at a time.

  • InviteeMaxFriendshipRequestsExceeded – The user you attempted to add has hit the max amount of friendship requests a user can have at a time. This is usually 700 total requests.

  • Forbidden – The client is not allowed to send friendship requests to the user because of the users settings.

  • HTTPException – An error occurred while requesting to add this friend.

async block_user(user_id)

This function is a coroutine.

Blocks a user by a given user id.

Parameters:

user_id (str) – The id of the user you want to block.

Raises:

HTTPException – Something went wrong when trying to block this user.

async close(*, close_http=True, dispatch_close=True)

This function is a coroutine.

Logs the user out and closes running services.

Parameters:
  • close_http (bool) – Whether or not to close the clients aiohttp.ClientSession when logged out.

  • dispatch_close (bool) – Whether or not to dispatch the close event.

Raises:

HTTPException – An error occurred while logging out.

event(event_or_coro=None)

A decorator to register an event.

Note

You do not need to decorate events in a subclass of BasicClient but the function names of event handlers must follow this format event_<event>.

Usage:

@client.event
async def event_friend_message(message):
    await message.reply('Thanks for your message!')

@client.event('friend_message')
async def my_message_handler(message):
    await message.reply('Thanks for your message!')
Raises:
  • TypeError – The decorated function is not a coroutine.

  • TypeError – Event is not specified as argument or function name with event prefix.

async fetch_active_ltms(region)

This function is a coroutine.

Fetches active LTMs for a specific region.

Parameters:

region (Region) – The region to request active LTMs for.

Raises:

HTTPException – An error occurred while requesting.

Returns:

List of internal playlist names. Returns an empty list of none LTMs are for the specified region.

Return type:

List[str]

async fetch_avatars(users)

This function is a coroutine.

Fetches the avatars of the provided user ids.

Warning

You can only fetch avatars of friends. That means that the bot has to be friends with the users you are requesting the avatars of.

Parameters:

users (List[str]) – A list containing user ids.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A dict containing avatars mapped to their user id.

Return type:

Dict[str, Avatar]

async fetch_battlepass_level(user_id, *, season, start_time=None, end_time=None)

This function is a coroutine.

Fetches a user’s battlepass level.

Parameters:
  • user_id (str) – The user id to fetch the battlepass level for.

  • season (Season) –

    The season enum to request the battlepass level for.

    Warning

    If you are requesting the previous season and the new season has not been added to the library yet (check SeasonStartTimestamp), you have to manually include the previous season’s end timestamp in epoch seconds.

  • start_time (Optional[Union[int, datetime.datetime]) – The UTC start time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime` or the ``start_timestamp`` value of a :class:`Season` e.g. `Season.C5SOG.start_timestamp` Defaults to None

  • end_time (Optional[Union[int, datetime.datetime]) – The UTC end time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime` or the ``start_timestamp`` value of a :class:`Season` e.g. `Season.C5SOG.start_timestamp` Defaults to None

Raises:
Returns:

The user’s battlepass level. None is returned if the user has not played any real matches this season.

Note

The decimals are the percent progress to the next level. E.g. 208.63 -> Level 208 and 63% on the way to 209.

Return type:

Optional[float]

async fetch_blocklist()

This function is a coroutine.

Retrieves the blocklist with an api call.

Raises:

HTTPException – An error occurred while fetching blocklist.

Returns:

List of ids

Return type:

List[str]

async fetch_br_news()

This function is a coroutine.

Fetches news for the Battle Royale gamemode.

Note

News is now specific to the player, most players who play regularly may get 1 or 2 different news posts to an account that has either never played or hasnt played in a while.

Raises:

HTTPException – An error occurred when requesting.

Returns:

List[BattleRoyaleNewsPost]

Return type:

list

async fetch_br_playlists()

This function is a coroutine.

Fetches all playlists registered on Fortnite. This includes all previous gamemodes that is no longer active.

Raises:

HTTPException – An error occurred while requesting.

Returns:

List containing all playlists registered on Fortnite.

Return type:

List[Playlist]

async fetch_br_stats(user_id, *, start_time=None, end_time=None)

This function is a coroutine.

Gets Battle Royale stats for the specified user.

Parameters:
  • user_id (str) – The id of the user you want to fetch stats for.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the ``start_timestamp`` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the ``end_timestamp`` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden

    The user has chosen to be hidden from public stats by disabling the fortnite setting below. | Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats for this user. If the user was not found None is returned.

Return type:

StatsV2

async fetch_creative_island(code)

This function is a coroutine.

Fetches a creative island or playlist by its code.

Parameters:

code (str) – Either the island code or playlist ID.

Raises:

HTTPException – An error occurred while requesting.

Returns:

Object representing the data of the creative island/playlist.

Return type:

CreativeIsland

async fetch_event_tokens(user_id)

This function is a coroutine.

Gets event tokens for the specified user.

Parameters:

user_id (str) – The id of the user you want to fetch event tokens for.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of event tokens.

Return type:

list[str]

async fetch_flag(user_id)

This function is a coroutine.

Gets current set flag for the specified user.

Parameters:

user_id (str) – The id of the user you want to fetch the flag for.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The users flag.

Return type:

Country | None

async fetch_item_shop()

This function is a coroutine.

Fetches the current item shop.

Example:

# fetches all CIDs (character ids) of of the current item shop.
async def get_current_item_shop_cids():
    store = await client.fetch_item_shop()

    cids = []
    for item in store.featured_items + store.daily_items:
        for grant in item.grants:
            if grant['type'] == 'AthenaCharacter':
                cids.append(grant['asset'])

    return cids
Raises:

HTTPException – An error occurred when requesting.

Returns:

Object representing the data from the current item shop.

Return type:

Store

async fetch_leaderboard(stat)

This function is a coroutine.

Fetches the leaderboard for a stat.

Warning

For some weird reason, the only valid stat you can pass is one with placetop1 (wins is also accepted).

Example usage:

async def get_leaderboard():
    stat = rebootpy.StatsV2.create_stat(
        'wins',
        rebootpy.V2Input.KEYBOARDANDMOUSE,
        'defaultsquad'
    )

    data = await client.fetch_leaderboard(stat)

    for placement, entry in enumerate(data):
        print('[{0}] Id: {1} | Wins: {2}'.format(
            placement, entry['account'], entry['value']))
Parameters:

stat (str) – The stat you are requesting the leaderboard entries for. You can use StatsV2.create_stat() to create this string.

Raises:
  • ValueError – You passed an invalid/non-accepted stat argument.

  • HTTPException – An error occurred when requesting.

Returns:

List of dictionaries containing entry data. Example return:

{
    'account': '4480a7397f824fe4b407077fb9397fbb',
    'value': 5082
}

Return type:

List[Dict[str, Union[str, int]]]

async fetch_lightswitch_status(service_id='Fortnite')

This function is a coroutine.

Fetches the lightswitch status of an epicgames service.

Parameters:

service_id (str) – The service id to check status for.

Raises:
  • ValueError – The returned data was empty. Most likely because service_id is not valid.

  • HTTPException – An error occurred when requesting.

Returns:

True if service is up else False

Return type:

bool

async fetch_multiple_battlepass_levels(users, season, *, start_time=None, end_time=None)

This function is a coroutine.

Fetches multiple users’ battlepass level.

Parameters:
  • users (List[str]) – List of user ids.

  • season (Season) – The season enum to request the battlepass levels for.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the window to get the battlepass level from. Must be seconds since epoch or a datetime.datetime instance. Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the window to get the battlepass level from. Must be seconds since epoch or a datetime.datetime instance. Defaults to None.

Raises:
  • ValueError – If end_time is earlier than the season’s start timestamp.

  • HTTPException – An error occurred while requesting.

Returns:

Users’ battlepass level mapped to their account id. Returns None if no battlepass level was found. If a user has career board set to private, they will not appear in the result. Therefore you should never expect a user to be included.

Note

The decimals are the percent progress to the next level. E.g. 208.63 -> Level 208 and 63% on the way to 209.

Note

If a user’s battlepass level is missing in the returned mapping, it means that the user has opted out of public leaderboards and that the client therefore does not have permission to request their stats.

Return type:

Dict[str, Optional[float]]

async fetch_multiple_br_stats(user_ids, stats, *, start_time=None, end_time=None)

This function is a coroutine.

Gets Battle Royale stats for multiple users at the same time.

Note

This function is not the same as doing fetch_br_stats() for multiple users. The expected return for this function would not be all the stats for the specified users but rather the stats you specify.

Example usage:

async def stat_function():
    stats = [
        rebootpy.StatsV2.create_stat('placetop1', rebootpy.V2Input.KEYBOARDANDMOUSE, 'defaultsolo'),
        rebootpy.StatsV2.create_stat('kills', rebootpy.V2Input.KEYBOARDANDMOUSE, 'defaultsolo'),
        rebootpy.StatsV2.create_stat('matchesplayed', rebootpy.V2Input.KEYBOARDANDMOUSE, 'defaultsolo')
    ]

    users = await self.fetch_users(['SypherPK', 'CouRageJD'])
    user_ids = [u.id for u in users]

    data = await self.fetch_multiple_br_stats(user_ids=user_ids, stats=stats)
    for id, res in data.items():
        if res is not None:
            print('ID: {0} | Stats: {1}'.format(id, res.get_stats()))
        else:
            print('ID: {0} not found.')

# Example output:
# ID: 463ca9d604524ce38071f512baa9cd70 | Stats: {'keyboardmouse': {'defaultsolo': {'wins': 759, 'kills': 28093, 'matchesplayed': 6438}}}
# ID: 3900c5958e4b4553907b2b32e86e03f8 | Stats: {'keyboardmouse': {'defaultsolo': {'wins': 1763, 'kills': 41375, 'matchesplayed': 7944}}}
# ID: NonValidUserIdForTesting not found.
Parameters:
  • user_ids (List[str]) – A list of ids you are requesting the stats for.

  • stats (List[str]) –

    A list of stats to get for the users. Use StatsV2.create_stat() to create the stats.

    Example:

    [
        rebootpy.StatsV2.create_stat('placetop1', rebootpy.V2Input.KEYBOARDANDMOUSE, 'defaultsolo'),
        rebootpy.StatsV2.create_stat('kills', rebootpy.V2Input.KEYBOARDANDMOUSE, 'defaultsolo'),
        rebootpy.StatsV2.create_stat('matchesplayed', rebootpy.V2Input.KEYBOARDANDMOUSE, 'defaultsolo')
    ]
    

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A mapping where StatsV2 is bound to its owners id. If a userid was not found then the value bound to that userid will be None.

Note

If a users stats is missing in the returned mapping it means that the user has opted out of public leaderboards and that the client therefore does not have permissions to request their stats.

Return type:

Dict[str, Optional[StatsV2]]

async fetch_multiple_br_stats_collections(user_ids, collection=None, *, start_time=None, end_time=None)

This function is a coroutine.

Gets Battle Royale stats collections for multiple users at the same time.

Parameters:
  • user_ids (List[str]) – A list of ids you are requesting the stats for.

  • collection (StatsCollectionType) – The collection to receive. Collections are predefined stats that it attempts to request.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A mapping where StatsCollection is bound to its owner’s id. If a userid was not found then the value bound to that userid will be None.

Note

If a user’s stats are missing in the returned mapping, it means that the user has opted out of public leaderboards and that the client therefore does not have permissions to request their stats.

Return type:

Dict[str, Optional[StatsCollection]]

async fetch_multiple_event_tokens(user_ids)

This function is a coroutine.

Gets event tokens for the specified users.

Parameters:

user_ids (list) – A list of user ids you want to fetch event tokens for.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A dictionary with user ids mapped to a list of tokens.

Return type:

dict

async fetch_multiple_flags(user_ids)

This function is a coroutine.

Gets the current set flags for the specified users.

Parameters:

user_ids (str) – A list of user ids you want to fetch flags for.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A dictionary with user ids mapped to a flag enum.

Return type:

dict[str, Country | None]

async fetch_party(party_id)

This function is a coroutine.

Fetches a party by its id.

Parameters:

party_id (str) – The id of the party.

Raises:

Forbidden – You are not allowed to look up this party.

Returns:

The party that was fetched. None if not found.

Return type:

Optional[Party]

async fetch_ranked_stats(user_id, season=None)

This function is a coroutine.

Gets ranked stats of the specified user, currently this works for all users even if they have their stats set to private.

Usage:

# get my C5S3 ranked stats
async def get_6v_ranked_stats():
    print(f'Fetching ranked stats for C5S3')

    user = await bot.fetch_user('6v.')
    ranks = await bot.fetch_ranked_stats(
        user_id=user.id,
        season=rebootpy.Season.C5S3
    )

    for rank in ranks:
        print(f'{rank.ranking_type.name} - {rank.current_division.name}')

# Example output:
# Fetching ranked stats for C5S3
# BATTLE_ROYALE - DIAMOND_2
# ROCKET_RACING - UNRANKED
# ZERO_BUILD - UNREAL
Parameters:
  • user_id (str) – The id of the user you want to fetch stats for.

  • season (Optional[Season]) – The season that you want to get ranks from. If not provided, it will get the current season’s ranked tracks automatically. Defaults to None

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of all of the user’s ranks in the requested season.

Return type:

List[CompetitiveRank]

async fetch_user(user, *, cache=False, raw=False)

This function is a coroutine.

Fetches a single user by the given id/displayname.

Parameters:
  • user (str) – Id or display name

  • cache (bool) –

    If set to True it will try to get the user from the friends or user cache and fall back to an api request if not found.

    Note

    Setting this parameter to False will make it an api call.

  • raw (bool) –

    If set to True it will return the data as you would get it from the api request.

    Note

    Setting raw to True does not work with cache set to True.

Raises:

HTTPException – An error occurred while requesting the user.

Returns:

The user requested. If not found it will return None

Return type:

Optional[User]

async fetch_user_by_display_name(display_name, *, cache=False, raw=False)

This function is a coroutine.

Fetches a user from the passed display name.

Parameters:
  • display_name (str) – The display name of the user you want to fetch the user for.

  • cache (bool) –

    If set to True it will try to get the user from the friends or user cache.

    Note

    Setting this parameter to False will make it an api call.

  • raw (bool) –

    If set to True it will return the data as you would get it from the api request.

    Note

    Setting raw to True does not work with cache set to True.

Raises:

HTTPException – An error occurred while requesting the user.

Returns:

The user requested. If not found it will return None.

Return type:

Optional[User]

async fetch_users(users, *, cache=False, raw=False)

This function is a coroutine.

Fetches multiple users at once by the given ids/displaynames.

Parameters:
  • users (Iterable[str]) – An iterable containing ids/displaynames.

  • cache (bool) –

    If set to True it will try to get the users from the friends or user cache and fall back to an api request if not found.

    Note

    Setting this parameter to False will make it an api call.

  • raw (bool) –

    If set to True it will return the data as you would get it from the api request.

    Note

    Setting raw to True does not work with cache set to True.

Raises:

HTTPException – An error occurred while requesting user information.

Returns:

Users requested. Only users that are found gets returned.

Return type:

List[User]

async fetch_users_by_display_name(display_name, *, raw=False)

This function is a coroutine.

Fetches all users including external users (accounts from other platforms) that matches the given the display name.

Warning

This function is not for requesting multiple users by multiple display names. Use BasicClient.fetch_user() for that.

Parameters:
  • display_name (str) – The display name of the users you want to get.

  • raw (bool) – If set to True it will return the data as you would get it from the api request. Defaults to ``False``

Raises:

HTTPException – An error occurred while requesting the user.

Returns:

A list containing all payloads found for this user.

Return type:

List[User]

is_closed()

bool: Whether the client is running or not.

is_ready()

Specifies if the internal state of the client is ready.

Returns:

True if the internal state is ready else False

Return type:

bool

remove_event_handler(event, coro)

Removes a coroutine as an event handler.

Parameters:
  • event (str) – The name of the event you want to remove this coro for.

  • coro (coroutine) – The coroutine that already functions as a handler for the specified event.

async remove_or_decline_friend(user_id)

This function is a coroutine.

Removes a friend by the given id.

Parameters:

user_id (str) – The id of the friend you want to remove.

Raises:

HTTPException – Something went wrong when trying to remove this friend.

async restart()

This function is a coroutine.

Restarts the client completely. All events received while this method runs are dispatched when it has finished.

Raises:
  • AuthException – Raised if invalid credentials in any form was passed or some other misc failure.

  • HTTPException – A request error occurred while logging in.

run()

This function starts the loop and then calls start() for you. If your program already has an asyncio loop setup, you should use start() instead.

Warning

This function is blocking and should be the last function to run.

Raises:
  • AuthException – Raised if invalid credentials in any form was passed or some other misc failure.

  • HTTPException – A request error occurred while logging in.

async search_sac_by_slug(slug)

This function is a coroutine.

Searches for an owner of slug + retrieves owners of similar slugs.

Parameters:

slug (str) – The slug (support a creator code) you wish to search for.

Raises:

HTTPException – An error occurred while requesting fortnite’s services.

Returns:

An ordered list of users who matched the exact or slightly modified slug.

Return type:

List[SacSearchEntryUser]

async search_users(prefix, platform)

This function is a coroutine.

Searches after users by a prefix and returns up to 100 matches.

Parameters:
  • prefix (str) –

    The prefix you want to search by. The prefix is case insensitive.
    Example: Tfue will return Tfue’s user + up to 99 other

    users which have display names that start with or match exactly to Tfue like Tfue_Faze dequan.

  • platform (UserSearchPlatform) –

    The platform you wish to search by.

    Note

    The platform is only important for prefix matches. All exact matches are returned regardless of which platform is specified.

Raises:

HTTPException – An error occurred while requesting.

Returns:

An ordered list of users that matched the prefix.

Return type:

List[UserSearchEntry]

set_presence(status, *, away=AwayStatus.ONLINE)[source]

This function is a coroutine.

Sends and sets the status. This status message will override all other presence statuses including party presence status.

Parameters:
Raises:

TypeError – The status you tried to set were not a str.

start(dispatch_ready=True)

This function is a coroutine.

Starts the client and logs into the specified user.

This method can be used as a coroutine or an async context manager, depending on your needs.

How to use as an async context manager: ::
async with client.start():

user = await client.fetch_user(‘Ninja’) print(user.display_name)

If you want to use it as an async context manager, but also keep the client running forever, you can await the return of start like this:

async with client.start() as future:
    user = await client.fetch_user('Ninja')
    print(user.display_name)

    await future  # Nothing after this line will run.

Warning

This method is blocking if you await it as a coroutine or you await the return future. This means that no code coming after will run until the client is closed. When the client is ready it will dispatch event_ready().

Parameters:

dispatch_ready (bool) – Whether or not the client should dispatch the ready event when ready.

Raises:
  • AuthException – Raised if invalid credentials in any form was passed or some other misc failure.

  • HTTPException – A request error occurred while logging in.

async unblock_user(user_id)

This function is a coroutine.

Unblocks a user by a given user id.

Parameters:

user_id (str) – The id of the user you want to unblock

Raises:

HTTPException – Something went wrong when trying to unblock this user.

wait_for(event, *, check=None, timeout=None)

This function is a coroutine.

Waits for an event to be dispatch.

In case the event returns more than one arguments, a tuple is passed containing the arguments.

Examples

This example waits for the author of a FriendMessage to say hello.:

@client.event
async def event_friend_message(message):
    await message.reply('Say hello!')

    def check_function(m):
        return m.author.id == message.author.id

    msg = await client.wait_for('message', check=check_function, timeout=60)
    await msg.reply('Hello {0.author.display_name}!'.format(msg))

This example waits for the the leader of a party to promote the bot after joining and then sets a new custom key:

@client.event
async def event_party_member_join(member):

    # checks if the member that joined is the UserClient
    if member.id != client.user.id:
        return

    def check(m):
        return m.id == client.user.id

    try:
        await client.wait_for('party_member_promote', check=check, timeout=120)
    except asyncio.TimeoutError:
        await member.party.send('You took too long to promote me!')

    await member.party.set_custom_key('my_custom_key_123')
Parameters:
  • event (str) –

    The name of the event.

    Note

    The name of the event must be without the event_

    prefix. | | Wrong = event_friend_message. | Correct = friend_message.

  • check (Optional[Callable]) – A predicate to check what to wait for. Defaults to a predicate that always returns True. This means it will return the first result unless you pass another predicate.

  • timeout (int) – How many seconds to wait for before asyncio.TimeoutError is raised. Defaults to ``None`` which means it will wait forever.

Raises:

asyncio.TimeoutError – No event was retrieved in the time you specified.

Returns:

Returns arguments based on the event you are waiting for. An event might return no arguments, one argument or a tuple of arguments. Check the event reference <rebootpy-events-api> for more information about the returning arguments.

Return type:

Any

async wait_until_closed()

This function is a coroutine.

Waits until the client is fully closed.

async wait_until_ready()

This function is a coroutine.

Waits until the internal state of the client is ready.

async send_presence(status, *, away=AwayStatus.ONLINE, to=None)[source]

This function is a coroutine.

Sends this status to all or one single friend.

Parameters:
  • status (Union[str, dict]) – The status message in str or full status in dict.

  • away (AwayStatus) – The away status to use. Defaults to AwayStatus.ONLINE.

  • to (Optional[aioxmpp.JID]) – The JID of the user that should receive this status. Defaults to None which means it will send to all friends.

Raises:

TypeError – Status was an invalid type.

async set_platform(platform)[source]

This function is a coroutine.

Sets and updates the clients platform. You may need to click off the lobby (i.e. go to your locker and back) to see platform changes in the same party.

Parameters:

platform (Platform) – The platform to set.

Raises:

HTTPException – An error occurred when requesting.

Utility Functions

Utility functions provided by the package.

rebootpy.run_multiple(clients, *, gap_timeout=0.2, shutdown_on_error=True, ready_callback=None, error_callback=None, all_ready_callback=None, before_start=None, before_close=None)[source]

This function sets up a loop and then calls start_multiple() for you. If you already have a running event loop, you should start the clients with start_multiple(). On shutdown, all clients will be closed gracefully.

Warning

This function is blocking and should be the last function to run.

Parameters:
  • clients (List[BasicClient]) – A list of the clients you wish to start.

  • gap_timeout (float) – The time to sleep between starting clients. Defaults to 0.2.

  • shutdown_on_error (bool) – If the function should cancel all other start tasks if one of the tasks fails. You can catch the error by try excepting.

  • ready_callback (Optional[Union[Callable[BasicClient], Awaitable[BasicClient]]]) – A callable/async callback taking a single parameter client. The callback is called whenever a client is ready.

  • error_callback (Optional[Union[Callable[BasicClient, Exception], Awaitable[BasicClient, Exception]]]) – A callable/async callback taking two parameters, BasicClient and an exception. The callback is called whenever a client fails logging in. The callback is not called if shutdown_on_error is True.

  • all_ready_callback (Optional[Union[Callable, Awaitable]]) – A callback/async callback that is called whenever all clients have finished logging in, regardless if one of the clients failed logging in. That means that the callback is always called when all clients are either logged in or raised an error.

  • before_start (Optional[Awaitable]) – An async callback that is called when just before the clients are beginning to start. This must be a coroutine as all the clients wait to start until this callback is finished processing so you can do heavy start stuff like opening database connections, sessions etc.

  • before_close (Optional[Awaitable]) – An async callback that is called when the clients are beginning to close. This must be a coroutine as all the clients wait to close until this callback is finished processing so you can do heavy close stuff like closing database connections, sessions etc.

Raises:
  • AuthException – Raised if invalid credentials in any form was passed or some other misc failure.

  • HTTPException – A request error occurred while logging in.

async rebootpy.start_multiple(clients, *, gap_timeout=0.2, shutdown_on_error=True, ready_callback=None, error_callback=None, all_ready_callback=None, before_start=None, before_close=None)[source]

This function is a coroutine.

Starts multiple clients at the same time.

Warning

This function is blocking and should be the last function to run.

Parameters:
  • clients (List[BasicClient]) – A list of the clients you wish to start.

  • gap_timeout (float) – The time to sleep between starting clients. Defaults to 0.2.

  • shutdown_on_error (bool) – If the function should cancel all other start tasks if one of the tasks fails. You can catch the error by try excepting.

  • ready_callback (Optional[Union[Callable[BasicClient], Awaitable[BasicClient]]]) – A callable/async callback taking a single parameter client. The callback is called whenever a client is ready.

  • error_callback (Optional[Union[Callable[BasicClient, Exception], Awaitable[BasicClient, Exception]]]) – A callable/async callback taking two parameters, BasicClient and an exception. The callback is called whenever a client fails logging in. The callback is not called if shutdown_on_error is True.

  • all_ready_callback (Optional[Union[Callable, Awaitable]]) – A callback/async callback that is called whenever all clients have finished logging in, regardless if one of the clients failed logging in. That means that the callback is always called when all clients are either logged in or raised an error.

  • before_start (Optional[Awaitable]) – An async callback that is called when just before the clients are beginning to start. This must be a coroutine as all the clients wait to start until this callback is finished processing so you can do heavy start stuff like opening database connections, sessions etc.

  • before_close (Optional[Awaitable]) – An async callback that is called when the clients are beginning to close. This must be a coroutine as all the clients wait to close until this callback is finished processing so you can do heavy close stuff like closing database connections, sessions etc.

Raises:
  • AuthException – Raised if invalid credentials in any form was passed or some other misc failure.

  • ValueError – Two or more clients with the same authentication identifier was passed. This means that you attemted to start two or more clients with the same credentials.

  • HTTPException – A request error occurred while logging in.

async rebootpy.close_multiple(clients)[source]

This function is a coroutine.

Closes multiple clients at the same time by calling BasicClient.close() on all of them.

Parameters:

clients (Iterable[BasicClient]) – An iterable of the clients you wish to close. If a client is already closing or closed, it will get skipped without raising an error.

Enumerations

class rebootpy.PartyPrivacy[source]

Specifies the privacy used in parties created by the client.

PUBLIC

Sets privacy to completely public. This means everyone can join the party, even friends of friends.

FRIENDS_ALLOW_FRIENDS_OF_FRIENDS

Sets privacy to only allow friends but friends of friends are able to join.

FRIENDS

Sets privacy to friends only.

PRIVATE_ALLOW_FRIENDS_OF_FRIENDS

Sets privacy to private but allows friends of friends.

PRIVATE

Sets privacy to private without the possibility of friends of friends joining.

class rebootpy.V2Input[source]

An enumeration for valid input types used for stats.

KEYBOARDANDMOUSE

Input type used for all users of keyboard and mouse. This is not only used for pc players but also other platforms where it’s possible to use keyboard and mouse.

GAMEPAD

Input type used for all players using a gamepad/controller. This is not only used for console players but also other platforms where it’s possible to use a gamepad/controller.

TOUCH

Input type used for all players using a touch display as controls. This is not only used for mobile players but also other platforms where it’s possible to use a touch display as controls.

class rebootpy.Region[source]

An enumeration for all currently available Fortnite regions.

NAEAST

The North America East region.

NAWEST

The North America West region.

NACENTRAL

The North America Central region.

EUROPE

The Europe region.

BRAZIL

The Brazil region.

OCEANIA

The Oceania region.

ASIA

The Asia region.

MIDDLEEAST

The Middle East region.

class rebootpy.Platform[source]

An enumeration for all currently available platforms.

WINDOWS
MAC
PLAYSTATION_4

Also accessible under PLAYSTATION for legacy reasons.

PLAYSTATION_5
XBOX_ONE

Also accessible under XBOX for legacy reasons.

XBOX_X
SWITCH
IOS
ANDROID
SWITCH_2
UNKNOWN

Used when an un-official client (e.g. one using a library similar to this) passes an invalid client to their presence such as EPIC, if you get this and it’s coming from a legitimate Fortnite client, please make an issue.

class rebootpy.ReadyState[source]

An enumeration for the available ready states.

READY
NOT_READY
SITTING_OUT
SLEEPING
class rebootpy.UserSearchPlatform[source]
EPIC_GAMES

This represents all platforms that use epic games as account service like PC and Mobile.

PLAYSTATION
XBOX
STEAM
class rebootpy.ProfileSearchMatchType
EXACT

The prefix matched the display name perfectly.

PREFIX

The prefix matched the start of the display name perfectly.

class rebootpy.AwayStatus[source]
ONLINE

User is currently active.

AWAY

User has set his status to away in-game

EXTENDED_AWAY

User is AFK. This can only be applied by the game and it is set after a specific time of no activity.

class rebootpy.StatsCollectionType[source]

An enumeration for stats collection types.

FISH
class rebootpy.Season[source]

An enumeration for a Fortnite season.

Attributes

These attributes are shared across all seasons:

  • start_timestamp (int): The start timestamp of the season in seconds since the epoch.

  • end_timestamp (int): The end timestamp of the season in seconds since the epoch.

  • battlepass_level (str or tuple): The StatsV2 value for this season’s battle pass level. None for seasons before Chapter 2.

  • ranked_tracks (tuple): The ranked tracks for this season. None for seasons before Chapter 4, Season 2.

You don’t need to use .value to access these; you can access them directly, e.g. Season.C5SOG.start_timestamp.

Enums

C1S1
C1S2
C1S3
C1S4
C1S5
C1S6
C1S7
C1S8
C1S9
C1SX
C2S1
C2S2
C2S3
C2S4
C2S5
C2S6
C2S7
C2S8
C3S1
C3S2
C3S3
C3S4
C4S1
C4S2
C4S3
C4S4
C4SOG
C5S1
C5S2
C5S3
C5S4
C5SOG
C6S1
class rebootpy.RankingType[source]

An enumeration for the available ranking types.

BATTLE_ROYALE
ZERO_BUILD
ROCKET_RACING
RELOAD
RELOAD_ZB
BALLISTIC
OG
OG_ZERO_BUILD
class rebootpy.Rank[source]

An enumeration for the available ranks.

UNRANKED
BRONZE_1
BRONZE_2
BRONZE_3
SILVER_1
SILVER_2
SILVER_3
GOLD_1
GOLD_2
GOLD_3
PLATINUM_1
PLATINUM_2
PLATINUM_3
DIAMOND_1
DIAMOND_2
DIAMOND_3
ELITE
CHAMPION
UNREAL
class rebootpy.Country[source]

An enumeration for the available selectable flags.

ARGENTINA
AUSTRALIA
BELARUS
BELGIUM
BRAZIL
CANADA
COLOMBIA
CZECHREPUBLIC
DENMARK
EGYPT
ENGLAND
FRANCE
GERMANY
GLOBAL
ICELAND
IRELAND
ITALY
JAPAN
LATVIA
MEXICO
NETHERLANDS
NEWZEALAND
NIGERIA
NORWAY
POLAND
PORTUGAL
RUSSIA
SAUDIARABIA
SCOTLAND
SOUTHKOREA
SPAIN
SWEDEN
SWITZERLAND
TURKEY
UKRAINE
UNITEDKINGDOM
UNITEDSTATES
URUGUAY
WALES

Event Reference

Events can be registered by the @client.event decorator. You do not need this decorator if you are in a subclass of Client.

Warning

All events must be registered as coroutines!

rebootpy.event_ready()

This event is called when the client .has been successfully established and connected to all services.

Note

This event is not called when the client starts in Client.close().

rebootpy.event_before_start()

This event is called and waited for before the client starts.

Warning

This event is not called when the client starts in Client.restart().

Note

This event behaves differently from the other events. The client will wait until the event handlers for this event is finished processing before actually closing. This makes it so you are able to do heavy and/or time consuming operations before the client fully logs out. This unfortunately also means that this event is not compatible with Client.wait_for().

rebootpy.event_before_close()

This event is called when the client is beginning to log out. This event also exists under the name event_close() for legacy reasons.

Warning

This event is not called when the client logs out in Client.restart().

Note

This event behaves differently from the other events. The client will wait until the event handlers for this event is finished processing before actually closing. This makes it so you are able to do heavy and/or time consuming operations before the client fully logs out. This unfortunately also means that this event is not compatible with Client.wait_for().

rebootpy.event_restart()

This event is called when the client has successfully restarted.

rebootpy.event_xmpp_session_establish()

Called whenever a xmpp session has been established. This can be called multiple times.

rebootpy.event_xmpp_session_lost()

Called whenever the xmpp connection is lost. This can happen when the internet connection is lost or if epics services goes down.

rebootpy.event_xmpp_session_close()

Called whenever the xmpp connection is closed. This means that it is called both when it’s lost or closed gracefully.

rebootpy.event_device_auth_generate(details)

This event is called whenever new device authentication details are generated.

Parameters:

details (dict) – A dictionary containing the keys device_id, account_id and secret.

rebootpy.event_device_code_generated(link)

This event is called whenever a device code link is generated during DeviceCodeAuth or AdvancedAuth.

Warning

If this event isn’t referenced, the device code link will be printed to the console.

Parameters:

link (str) – The link to complete the device code login.

rebootpy.event_auth_refresh()

This event is called when the clients authentication has been refreshed.

rebootpy.event_friend_message(message)

This event is called when ClientUser receives a private message.

Parameters:

message (FriendMessage) – Message object.

rebootpy.event_party_message(message)

This event is called when ClientUser’s party receives a message.

Parameters:

message (PartyMessage) – Message object.

rebootpy.event_friend_add(friend)

This event is called when a friend has been added.

Note

This event is called regardless of the direction. That means it will get called even if the client were to be the one to accept the user.

Parameters:

friend (Friend) – Friend that has been added.

rebootpy.event_friend_remove(friend)

This event is called when a friend has been removed from the friendlist.

Note

This event is called regardless of the direction. That means it will get called even if the client were to be the one to remove the friend.

Parameters:

friend (Friend) – Friend that was removed.

rebootpy.event_friend_request(request)

This event is called when the client receives a friend request.

Parameters:

request (Union[IncomingPendingFriend, OutgoingPendingFriend]) – Request object.

rebootpy.event_friend_request_decline(friend)

This event is called when a friend request is declined.

Parameters:

request (Union[IncomingPendingFriend, OutgoingPendingFriend]) – Request object.

rebootpy.event_friend_request_abort(friend)

This event is called when a friend request is aborted. Aborted means that the friend request was deleted before the receiving user managed to accept it.

Parameters:

request (Union[IncomingPendingFriend, OutgoingPendingFriend]) – Request object.

rebootpy.event_friend_presence(before, after)

This event is called when the client receives a presence from a friend. Presence is received when a user logs into fortnite, closes fortnite or when an user does an action when logged in e.g. joins into a game or joins a party.

Parameters:
  • before (Optional[Presence]) – The previously received presence object. Can be None usually because the friend was previously offline or because the client just started and therefore no presence had been already stored in the presence cache.

  • after (Presence) – The new presence object.

rebootpy.event_party_invite(invitation)

This event is called when a party invitation is received.

Parameters:

invitation (ReceivedPartyInvitation) – Invitation object.

rebootpy.event_invalid_party_invite(friend)

This event is called whenever you received an invite that was invalid. Usually this is because the invite was from a private party you have been kicked from.

Parameters:

friend (Friend) – The friend that invited you.

rebootpy.event_party_member_promote(old_leader, new_leader)

This event is called when a new partyleader has been promoted.

Parameters:
  • old_leader (PartyMember) – Member that was previously leader.

  • new_leader (PartyMember) – Member that was promoted.

rebootpy.event_party_member_kick(member)

This event is called when a member has been kicked from the party.

Parameters:

member (PartyMember) – The member that was kicked.

rebootpy.event_party_member_zombie(member)

This event is called when a members connection was lost and therefore entered a zombie state waiting for their offline time to live expires. If the connection is restored before timing out, event_party_member_reconnect() is called. If not then event_party_member_expire() is called when their time to live runs out.

Parameters:

member (PartyMember) – The member that lost its connection.

rebootpy.event_party_member_reconnect(member)

This event is called when a member reconnects after losing their connection.

Parameters:

member (PartyMember) – The member that reconnected.

rebootpy.event_party_member_expire(member)

This event is called when a member expires after being in their zombie state for 30 seconds.

Parameters:

member (PartyMember) – The member that expired.

rebootpy.event_party_update(party)

This event is called when ClientUser’s partymeta is updated. An example of when this is called is when a new custom key has been set.

Parameters:

party (Party) – The party that was updated.

rebootpy.event_party_member_update(member)

This event is called when the meta of a member of ClientUser’s party is updated. An example of when this might get called is when a member changes outfit.

Parameters:

member (PartyMember) – The member whos meta was updated.

rebootpy.event_party_member_join(member)

This event is called when a new member has joined ClientUser’s party.

Parameters:

member (PartyMember) – The member who joined.

rebootpy.event_party_member_leave(member)

This event is called when a member leaves the party.

Parameters:

member (PartyMember) – The member who left the party.

rebootpy.event_party_member_confirm(confirmation)

This event is called when a member asks to join the party.

Warning

This event is automatically handled by the client which automatically always accepts the user. If you have this event referenced in your code the client won’t automatically handle it anymore and you must handle it yourself.

Note

This event differs from event_party_join_request() by the fact that this event is fired whenever someone is in the middle of joining the party, while event_party_join_request() is called when someone explicitly requests to join your private party.

Parameters:

confirmation (PartyJoinConfirmation) – Confirmation object with accessible confirmation methods.

rebootpy.event_party_join_request(request)

This event is called when a friend requests to join your private party.

Note

This event differs from event_party_member_confirm() by the fact that this event is called when someone explicitly requests to join the bots party, while event_party_member_confirm() is an event that is fired whenever someone is in the middle of joining the party.

Parameters:

request (PartyJoinRequest) – Request object.

rebootpy.event_party_invite_decline(friend)

This event is called when an invite has been declined.

Parameters:

friend – The friend who declined the invite.

rebootpy.event_party_playlist_change(party, before, after)

This event is called when the playlist data has been changed.

Parameters:
  • party (ClientParty) – The party that changed.

  • before (tuple) – The previous playlist data. Same structure as ClientParty.playlist_info.

  • after (tuple) – The current playlist data. Same structure as ClientParty.playlist_info.

rebootpy.event_party_squad_fill_change(party, before, after)

This event is called when squad fill has been changed.

Parameters:
  • party (ClientParty) – The party that changed.

  • before (bool) – The previous squad fill value.

  • after (bool) – The current squad fill value.

rebootpy.event_party_privacy_change(party, before, after)

This event is called when the party privacy has been changed.

Parameters:
  • party (ClientParty) – The party that changed.

  • before (Privacy) – The previous party privacy.

  • after (Privacy) – The current party privacy.

rebootpy.event_party_member_team_swap(member, other)

Note

Because of how party teams work, you can swap team with another member without their permission. If you don’t want this to be possible, you can set team_change_allowed to False in DefaultPartyConfig.

This event is called whenever a party member swaps their position. If the member switches to a position that was taken my another member, the two members will swap positions. You can get their new positions from PartyMember.position.

Parameters:
  • member (PartyMember) – The member that instigated the team swap.

  • other (Optional[PartyMember]) – The member that was swapped teams with. If no member was previously holding the position, this will be None.

rebootpy.event_party_member_ready_change(member, before, after)

This event is called when a members ready state has changed.

Parameters:
rebootpy.event_party_member_input_change(member, before, after)

This event is called when a members input has been changed.

Parameters:
  • member (PartyMember) – The member that changed.

  • before (str) – The previous input.

  • after (str) – The current input.

rebootpy.event_party_member_outfit_change(member, before, after)

This event is called when a members outfit has been changed.

Parameters:
  • member (PartyMember) – The member that changed.

  • before (str) – The previous outfit cid.

  • after (str) – The current outfit cid.

rebootpy.event_party_member_backpack_change(member, before, after)

This event is called when a members backpack has been changed.

Parameters:
  • member (PartyMember) – The member that changed.

  • before (str) – The previous backpack bid.

  • after (str) – The current backpack bid.

rebootpy.event_party_member_pet_change(member, before, after)

This event is called when a members pet has been changed.

Parameters:
  • member (PartyMember) – The member that changed.

  • before (str) – The previous pet id.

  • after (str) – The current pet id.

rebootpy.event_party_member_pickaxe_change(member, before, after)

This event is called when a members pickaxe has been changed.

Parameters:
  • member (PartyMember) – The member that changed.

  • before (str) – The previous pickaxe pid.

  • after (str) – The current pickaxe pid.

rebootpy.event_party_member_contrail_change(member, before, after)

This event is called when a members contrail has been changed.

Parameters:
  • member (PartyMember) – The member that changed.

  • before (str) – The previous contrail id.

  • after (str) – The current contrail id.

rebootpy.event_party_member_emote_change(member, before, after)

This event is called when a members emote has been changed.

Parameters:
  • member (PartyMember) – The member that changed.

  • before (str) – The previous emote eid. None if no emote was currently playing.

  • after (str) – The current emote eid. None if the emote was stopped.

rebootpy.event_party_member_emoji_change(member, before, after)

This event is called when a members emoji has been changed.

Parameters:
  • member (PartyMember) – The member that changed.

  • before (str) – The previous emoji id. None if no emoji was currently playing.

  • after (str) – The current emoji id. None if the emoji was stopped.

rebootpy.event_party_member_banner_change(member, before, after)

This event is called when a members banner has been changed.

Parameters:
rebootpy.event_party_member_battlepass_info_change(member, before, after)

This event is called when a members battlepass info has been changed.

Parameters:
rebootpy.event_party_member_enlightenments_change(member, before, after)

This event is called when a members enlightenments values are changed.

Parameters:
  • member (PartyMember) – The member that changed.

  • before (list) – The previous enlightenment values.

  • after (list) – The current enlightenment values.

rebootpy.event_party_member_corruption_change(member, before, after)

This event is called when a members corruption value is changed.

Parameters:
  • member (PartyMember) – The member that changed.

  • before (Optional[list]) – The previous corruption value. Could be None if not set.

  • after (Optional[list]) – The current corruption value. Could be None if not set.

rebootpy.event_party_member_outfit_variants_change(member, before, after)

This event is called when a members outfit variants been changed.

Parameters:
rebootpy.event_party_member_backpack_variants_change(member, before, after)

This event is called when a members backpack variants been changed.

Parameters:
rebootpy.event_party_member_pickaxe_variants_change(member, before, after)

This event is called when a members pickaxe variants been changed.

Parameters:
rebootpy.event_party_member_contrail_variants_change(member, before, after)

This event is called when a members contrail variants been changed.

Parameters:
rebootpy.event_party_member_in_match_change(member, before, after)

This event is called when a member join or leaves a match.

Parameters:
  • member (PartyMember) – The member that changed.

  • before (bool) – The previous match state.

  • after (bool) – The new and current match state.

rebootpy.event_party_member_match_players_left_change(member, before, after)

This event is called when the servercount changes in the match the member is currently in.

Parameters:
  • member (PartyMember) – The member that changed.

  • before (int) – The previous servercount.

  • after (int) – The new and current servercount.

rebootpy.event_party_member_lobby_map_marker_is_visible_change(member, before, after)

This event is called when the visibility of a members lobby map marker is toggled.

Parameters:
  • member (PartyMember) – The member that changed.

  • before (bool) – Whether or not the marker used to be visible.

  • after (bool) – Whether or not the marker is now currently visible.

rebootpy.event_party_member_lobby_map_marker_coordinates_change(member, before, after)

This event is called when the coordinates of a members lobby map marker is changed.

Parameters:
  • member (PartyMember) – The member that changed.

  • before (Tuple[float, class:float]) – The previous coordinates.

  • after (Tuple[float, class:float]) – The new coordinates.

rebootpy.event_party_member_playlist_selection_change(member, before, after)

This event is called when a party member selects a different playlist.

Parameters:
  • member (PartyMember) – The member that changed.

  • before (str) – The previous playlist id/island code.

  • after (str) – The new playlist id/island code.

Stats Reference

Gamemode names

Since stats received from Fortnite’s services changes all the time by adding new gamemodes and such, none of the gamemode names have been changed from the original response gotten from the request. Therefore, if you want to access a users solo stats, you must use the internal name for the solo gamemode: defaultsolo.

There is no good, easy way of retrieving all these internal names. So for now the best way you can do this is by fetching stats from someone that has played a lot of different gamemode e.g. the user Dark (more known as Dakotaz) and just write the gamemode names down.

Stats

Default Solos Gamemode (defaultsolo)

{
  'wins': int,
  'placetop10': int,
  'placetop25': int,
  'kills': int,
  'score': int,
  'playersoutlives': int,
  'minutesplayed': int,
  'matchesplayed': int,
  'lastmodified': datetime.datetime,
}

Default Duos Gamemode (defaultduo)

{
  'wins': int,
  'placetop5': int,
  'placetop12': int,
  'kills': int,
  'score': int,
  'playersoutlives': int,
  'minutesplayed': int,
  'matchesplayed': int,
  'lastmodified': datetime.datetime,
}

Default Trios Gamemode (trios)

{
  'wins': int,
  'kills': int,
  'score': int,
  'playersoutlives': int,
  'minutesplayed': int,
  'matchesplayed': int,
  'lastmodified': datetime.datetime,
}

Default Squads Gamemode (defaultsquad)

{
  'wins': int,
  'placetop3': int,
  'placetop6': int,
  'kills': int,
  'score': int,
  'playersoutlives': int,
  'minutesplayed': int,
  'matchesplayed': int,
  'lastmodified': datetime.datetime,
}

Fortnite Models

Danger

The classes below should never be created by users. These are classed representing data received from fortnite’s services.

ClientUser

class rebootpy.ClientUser[source]

Represents the user the client is connected to.

client

The client.

Type:

BasicClient

age_group

The age group of the user.

Type:

str

can_update_display_name

True if the user can update it’s displayname else False

Type:

bool

country

The country the user wasregistered in.

Type:

str

email

The email of the user.

Warning

Can be None if account is headless.

Type:

str

failed_login_attempts

Failed login attempts

Type:

str

headless

True if the account has no display name due to no epicgames account being linked to the current account.

Type:

bool

last_login

UTC time of the last login of the user. None if no failed login attempt has been registered.

Type:

datetime.datetime

name

First name of the user.

Warning

Can be None if account is headless.

Type:

str

first_name

First name of the user. Alias for name.

Warning

Can be None if account is headless.

Type:

str

last_name

Last name of the user.

Warning

Can be None if account is headless.

Type:

str

full_name

Full name of the user.

Warning

Can be None if account is headless.

Type:

str

number_of_display_name_changes

Amount of displayname changes.

Type:

int

preferred_language

Users preferred language.

Type:

str

tfa_enabled

True if the user has two-factor authentication enabled else False.

Type:

bool

email_verified

True if the accounts email has been verified.

Type:

bool

minor_verified

True if the account has been verified to be run by a minor.

Type:

bool

minor_expected

True if the account is expected to be run by a minor.

Type:

bool

minor_status

The minor status of this account.

Type:

str

property jid

The JID of the client. Includes the resource part.

Type:

aioxmpp.JID

property disabled

Whether or not this users account is disabled, meaning they cannot login. Other attributes/functions may not work properly if this is true.

Type:

bool

property display_name

The users displayname

Warning

The display name will be the one registered to the epicgames account. If an epicgames account is not found it defaults to the display name of an external auth.

Warning

This property might be None if Client.fetch_user_data_in_events is set to False.

Type:

Optional[str]

property epicgames_account

Tells you if the user is an account registered to epicgames services. False if the user is from another platform without having linked their account to an epicgames account.

Warning

If this is True, the display name will be the one registered to the epicgames account, if not it defaults to the display name of an external auth.

Warning

This property might be False even though the account is a registered epic games account if Client.fetch_user_data_in_events is set to False.

Type:

bool

property external_auths

List containing information about external auths. Might be empty if the user does not have any external auths.

Type:

List[ExternalAuth]

async fetch()

This function is a coroutine.

Fetches basic information about this user and sets the updated properties. This might be useful if you for example need to be sure the display name is updated or if you have Client.fetch_user_data_in_events set to False.

Raises:

HTTPException – An error occurred while requesting.

async fetch_battlepass_level(*, season, start_time=None, end_time=None)

This function is a coroutine.

Fetches the user’s battlepass level.

Parameters:
  • season (BattlePassStat) –

    The season enum to request the battlepass level for.

    Warning

    If you are requesting the previous season and the new season has not been added to the library yet (check Season), you have to manually include the previous season’s end timestamp in epoch seconds.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The user’s battlepass level. None is returned if the user has not played any real matches this season.

Note

The decimals are the percent progress to the next level. E.g. 208.63 -> Level 208 and 63% on the way to 209.

Return type:

Optional[float]

async fetch_br_stats(*, start_time=None, end_time=None)

This function is a coroutine.

Fetches the user’s stats.

Parameters:
  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden – The user has chosen to be hidden from public stats by disabling the Fortnite setting below. Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats for this user.

Return type:

StatsV2

async fetch_br_stats_collection(collection, start_time=None, end_time=None)

This function is a coroutine.

Fetches a stats collection for this user.

Parameters:
  • collection (StatsCollectionType) – The collection to receive. Collections are predefined stats that attempt to request specific information.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden – The user has chosen to be hidden from public stats by disabling the Fortnite setting below. Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats collection for this user.

Return type:

StatsCollection

async fetch_event_tokens()

This function is a coroutine.

Fetches this user’s event tokens.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of event tokens.

Return type:

list[str]

async fetch_flag()

This function is a coroutine.

Fetches this user’s flag.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The users flag.

Return type:

Country | None

async fetch_ranked_stats(season=None)

This function is a coroutine.

Fetches this user’s ranked stats, currently this works for all users even if they have their stats set to private.

Usage:

# get my C5S3 ranked stats
async def get_6v_ranked_stats():
    print(f'Fetching ranked stats for C5S3')

    user = await bot.fetch_user('6v.')
    ranks = await user.fetch_ranked_stats(
        season=rebootpy.Season.C5S3
    )

    for rank in ranks:
        print(f'{rank.ranking_type.name} - {rank.current_division.name}')

# Example output:
# Fetching ranked stats for C5S3
# BATTLE_ROYALE - DIAMOND_2
# ROCKET_RACING - UNRANKED
# ZERO_BUILD - UNREAL
Parameters:

season (Optional[Season]) – The season that you want to get ranks from. If not provided, it will get the current season’s ranked tracks automatically. Defaults to None

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of all of the user’s ranks in the requested season.

Return type:

List[CompetitiveRank]

property id

The users id

Type:

str

ExternalAuth

class rebootpy.ExternalAuth[source]

Represents an external auth belonging to a user.

client

The client.

Type:

BasicClient

type

The type/platform of the external auth.

Type:

str:

id

The users universal fortnite id.

Type:

str:

external_id

The id belonging to this user on the platform. This could in some cases be None.

Type:

Optional[str]

external_display_name

The display name belonging to this user on the platform. This could in some cases be None.

Type:

Optional[str]

extra_info

Extra info from the payload. Usually empty on accounts other than ClientUser.

Type:

Dict[str, Any]

User

class rebootpy.User[source]

Represents a user from Fortnite

async block()[source]

This function is a coroutine.

Blocks this user.

Raises:

HTTPException – Something went wrong while blocking this user.

async add()[source]

This function is a coroutine.

Sends a friendship request to this user or adds them if they have already sent one to the client.

Raises:
  • NotFound – The specified user does not exist.

  • DuplicateFriendship – The client is already friends with this user.

  • FriendshipRequestAlreadySent – The client has already sent a friendship request that has not been handled yet by the user.

  • MaxFriendshipsExceeded – The client has hit the max amount of friendships a user can have at a time. For most accounts this limit is set to 1000 but it could be higher for others.

  • InviteeMaxFriendshipsExceeded – The user you attempted to add has hit the max amount of friendships a user can have at a time.

  • InviteeMaxFriendshipRequestsExceeded – The user you attempted to add has hit the max amount of friendship requests a user can have at a time. This is usually 700 total requests.

  • Forbidden – The client is not allowed to send friendship requests to the user because of the users settings.

  • HTTPException – An error occurred while requesting to add this friend.

property disabled

Whether or not this users account is disabled, meaning they cannot login. Other attributes/functions may not work properly if this is true.

Type:

bool

property display_name

The users displayname

Warning

The display name will be the one registered to the epicgames account. If an epicgames account is not found it defaults to the display name of an external auth.

Warning

This property might be None if Client.fetch_user_data_in_events is set to False.

Type:

Optional[str]

property epicgames_account

Tells you if the user is an account registered to epicgames services. False if the user is from another platform without having linked their account to an epicgames account.

Warning

If this is True, the display name will be the one registered to the epicgames account, if not it defaults to the display name of an external auth.

Warning

This property might be False even though the account is a registered epic games account if Client.fetch_user_data_in_events is set to False.

Type:

bool

property external_auths

List containing information about external auths. Might be empty if the user does not have any external auths.

Type:

List[ExternalAuth]

async fetch()

This function is a coroutine.

Fetches basic information about this user and sets the updated properties. This might be useful if you for example need to be sure the display name is updated or if you have Client.fetch_user_data_in_events set to False.

Raises:

HTTPException – An error occurred while requesting.

async fetch_battlepass_level(*, season, start_time=None, end_time=None)

This function is a coroutine.

Fetches the user’s battlepass level.

Parameters:
  • season (BattlePassStat) –

    The season enum to request the battlepass level for.

    Warning

    If you are requesting the previous season and the new season has not been added to the library yet (check Season), you have to manually include the previous season’s end timestamp in epoch seconds.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The user’s battlepass level. None is returned if the user has not played any real matches this season.

Note

The decimals are the percent progress to the next level. E.g. 208.63 -> Level 208 and 63% on the way to 209.

Return type:

Optional[float]

async fetch_br_stats(*, start_time=None, end_time=None)

This function is a coroutine.

Fetches the user’s stats.

Parameters:
  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden – The user has chosen to be hidden from public stats by disabling the Fortnite setting below. Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats for this user.

Return type:

StatsV2

async fetch_br_stats_collection(collection, start_time=None, end_time=None)

This function is a coroutine.

Fetches a stats collection for this user.

Parameters:
  • collection (StatsCollectionType) – The collection to receive. Collections are predefined stats that attempt to request specific information.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden – The user has chosen to be hidden from public stats by disabling the Fortnite setting below. Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats collection for this user.

Return type:

StatsCollection

async fetch_event_tokens()

This function is a coroutine.

Fetches this user’s event tokens.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of event tokens.

Return type:

list[str]

async fetch_flag()

This function is a coroutine.

Fetches this user’s flag.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The users flag.

Return type:

Country | None

async fetch_ranked_stats(season=None)

This function is a coroutine.

Fetches this user’s ranked stats, currently this works for all users even if they have their stats set to private.

Usage:

# get my C5S3 ranked stats
async def get_6v_ranked_stats():
    print(f'Fetching ranked stats for C5S3')

    user = await bot.fetch_user('6v.')
    ranks = await user.fetch_ranked_stats(
        season=rebootpy.Season.C5S3
    )

    for rank in ranks:
        print(f'{rank.ranking_type.name} - {rank.current_division.name}')

# Example output:
# Fetching ranked stats for C5S3
# BATTLE_ROYALE - DIAMOND_2
# ROCKET_RACING - UNRANKED
# ZERO_BUILD - UNREAL
Parameters:

season (Optional[Season]) – The season that you want to get ranks from. If not provided, it will get the current season’s ranked tracks automatically. Defaults to None

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of all of the user’s ranks in the requested season.

Return type:

List[CompetitiveRank]

property id

The users id

Type:

str

property jid

The JID of the user.

Type:

aioxmpp.JID

BlockedUser

class rebootpy.BlockedUser[source]

Represents a blocked user from Fortnite

async unblock()[source]

This function is a coroutine.

Unblocks this friend.

property disabled

Whether or not this users account is disabled, meaning they cannot login. Other attributes/functions may not work properly if this is true.

Type:

bool

property display_name

The users displayname

Warning

The display name will be the one registered to the epicgames account. If an epicgames account is not found it defaults to the display name of an external auth.

Warning

This property might be None if Client.fetch_user_data_in_events is set to False.

Type:

Optional[str]

property epicgames_account

Tells you if the user is an account registered to epicgames services. False if the user is from another platform without having linked their account to an epicgames account.

Warning

If this is True, the display name will be the one registered to the epicgames account, if not it defaults to the display name of an external auth.

Warning

This property might be False even though the account is a registered epic games account if Client.fetch_user_data_in_events is set to False.

Type:

bool

property external_auths

List containing information about external auths. Might be empty if the user does not have any external auths.

Type:

List[ExternalAuth]

async fetch()

This function is a coroutine.

Fetches basic information about this user and sets the updated properties. This might be useful if you for example need to be sure the display name is updated or if you have Client.fetch_user_data_in_events set to False.

Raises:

HTTPException – An error occurred while requesting.

async fetch_battlepass_level(*, season, start_time=None, end_time=None)

This function is a coroutine.

Fetches the user’s battlepass level.

Parameters:
  • season (BattlePassStat) –

    The season enum to request the battlepass level for.

    Warning

    If you are requesting the previous season and the new season has not been added to the library yet (check Season), you have to manually include the previous season’s end timestamp in epoch seconds.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The user’s battlepass level. None is returned if the user has not played any real matches this season.

Note

The decimals are the percent progress to the next level. E.g. 208.63 -> Level 208 and 63% on the way to 209.

Return type:

Optional[float]

async fetch_br_stats(*, start_time=None, end_time=None)

This function is a coroutine.

Fetches the user’s stats.

Parameters:
  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden – The user has chosen to be hidden from public stats by disabling the Fortnite setting below. Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats for this user.

Return type:

StatsV2

async fetch_br_stats_collection(collection, start_time=None, end_time=None)

This function is a coroutine.

Fetches a stats collection for this user.

Parameters:
  • collection (StatsCollectionType) – The collection to receive. Collections are predefined stats that attempt to request specific information.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden – The user has chosen to be hidden from public stats by disabling the Fortnite setting below. Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats collection for this user.

Return type:

StatsCollection

async fetch_event_tokens()

This function is a coroutine.

Fetches this user’s event tokens.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of event tokens.

Return type:

list[str]

async fetch_flag()

This function is a coroutine.

Fetches this user’s flag.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The users flag.

Return type:

Country | None

async fetch_ranked_stats(season=None)

This function is a coroutine.

Fetches this user’s ranked stats, currently this works for all users even if they have their stats set to private.

Usage:

# get my C5S3 ranked stats
async def get_6v_ranked_stats():
    print(f'Fetching ranked stats for C5S3')

    user = await bot.fetch_user('6v.')
    ranks = await user.fetch_ranked_stats(
        season=rebootpy.Season.C5S3
    )

    for rank in ranks:
        print(f'{rank.ranking_type.name} - {rank.current_division.name}')

# Example output:
# Fetching ranked stats for C5S3
# BATTLE_ROYALE - DIAMOND_2
# ROCKET_RACING - UNRANKED
# ZERO_BUILD - UNREAL
Parameters:

season (Optional[Season]) – The season that you want to get ranks from. If not provided, it will get the current season’s ranked tracks automatically. Defaults to None

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of all of the user’s ranks in the requested season.

Return type:

List[CompetitiveRank]

property id

The users id

Type:

str

property jid

The JID of the user.

Type:

aioxmpp.JID

UserSearchEntry

class rebootpy.UserSearchEntry[source]

Represents a user entry in a user search.

Parameters:
  • matches (List[Tuple[str, UserSearchPlatform]]) –

    A list of tuples containing the display name the user matched

    and the platform the display name is from. | Example: [('Tfue', UserSearchPlatform.EPIC_GAMES)]

  • match_type (UserSearchMatchType) – The type of match this user matched by.

  • mutual_friend_count (int) – The amount of epic mutual friends the client has with the user.

async add()

This function is a coroutine.

Sends a friendship request to this user or adds them if they have already sent one to the client.

Raises:
  • NotFound – The specified user does not exist.

  • DuplicateFriendship – The client is already friends with this user.

  • FriendshipRequestAlreadySent – The client has already sent a friendship request that has not been handled yet by the user.

  • MaxFriendshipsExceeded – The client has hit the max amount of friendships a user can have at a time. For most accounts this limit is set to 1000 but it could be higher for others.

  • InviteeMaxFriendshipsExceeded – The user you attempted to add has hit the max amount of friendships a user can have at a time.

  • InviteeMaxFriendshipRequestsExceeded – The user you attempted to add has hit the max amount of friendship requests a user can have at a time. This is usually 700 total requests.

  • Forbidden – The client is not allowed to send friendship requests to the user because of the users settings.

  • HTTPException – An error occurred while requesting to add this friend.

async block()

This function is a coroutine.

Blocks this user.

Raises:

HTTPException – Something went wrong while blocking this user.

property disabled

Whether or not this users account is disabled, meaning they cannot login. Other attributes/functions may not work properly if this is true.

Type:

bool

property display_name

The users displayname

Warning

The display name will be the one registered to the epicgames account. If an epicgames account is not found it defaults to the display name of an external auth.

Warning

This property might be None if Client.fetch_user_data_in_events is set to False.

Type:

Optional[str]

property epicgames_account

Tells you if the user is an account registered to epicgames services. False if the user is from another platform without having linked their account to an epicgames account.

Warning

If this is True, the display name will be the one registered to the epicgames account, if not it defaults to the display name of an external auth.

Warning

This property might be False even though the account is a registered epic games account if Client.fetch_user_data_in_events is set to False.

Type:

bool

property external_auths

List containing information about external auths. Might be empty if the user does not have any external auths.

Type:

List[ExternalAuth]

async fetch()

This function is a coroutine.

Fetches basic information about this user and sets the updated properties. This might be useful if you for example need to be sure the display name is updated or if you have Client.fetch_user_data_in_events set to False.

Raises:

HTTPException – An error occurred while requesting.

async fetch_battlepass_level(*, season, start_time=None, end_time=None)

This function is a coroutine.

Fetches the user’s battlepass level.

Parameters:
  • season (BattlePassStat) –

    The season enum to request the battlepass level for.

    Warning

    If you are requesting the previous season and the new season has not been added to the library yet (check Season), you have to manually include the previous season’s end timestamp in epoch seconds.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The user’s battlepass level. None is returned if the user has not played any real matches this season.

Note

The decimals are the percent progress to the next level. E.g. 208.63 -> Level 208 and 63% on the way to 209.

Return type:

Optional[float]

async fetch_br_stats(*, start_time=None, end_time=None)

This function is a coroutine.

Fetches the user’s stats.

Parameters:
  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden – The user has chosen to be hidden from public stats by disabling the Fortnite setting below. Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats for this user.

Return type:

StatsV2

async fetch_br_stats_collection(collection, start_time=None, end_time=None)

This function is a coroutine.

Fetches a stats collection for this user.

Parameters:
  • collection (StatsCollectionType) – The collection to receive. Collections are predefined stats that attempt to request specific information.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden – The user has chosen to be hidden from public stats by disabling the Fortnite setting below. Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats collection for this user.

Return type:

StatsCollection

async fetch_event_tokens()

This function is a coroutine.

Fetches this user’s event tokens.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of event tokens.

Return type:

list[str]

async fetch_flag()

This function is a coroutine.

Fetches this user’s flag.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The users flag.

Return type:

Country | None

async fetch_ranked_stats(season=None)

This function is a coroutine.

Fetches this user’s ranked stats, currently this works for all users even if they have their stats set to private.

Usage:

# get my C5S3 ranked stats
async def get_6v_ranked_stats():
    print(f'Fetching ranked stats for C5S3')

    user = await bot.fetch_user('6v.')
    ranks = await user.fetch_ranked_stats(
        season=rebootpy.Season.C5S3
    )

    for rank in ranks:
        print(f'{rank.ranking_type.name} - {rank.current_division.name}')

# Example output:
# Fetching ranked stats for C5S3
# BATTLE_ROYALE - DIAMOND_2
# ROCKET_RACING - UNRANKED
# ZERO_BUILD - UNREAL
Parameters:

season (Optional[Season]) – The season that you want to get ranks from. If not provided, it will get the current season’s ranked tracks automatically. Defaults to None

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of all of the user’s ranks in the requested season.

Return type:

List[CompetitiveRank]

property id

The users id

Type:

str

property jid

The JID of the user.

Type:

aioxmpp.JID

SacSearchEntryUser

class rebootpy.SacSearchEntryUser[source]

Represents a user entry in a support a creator code search.

Parameters:
  • slug (str) – The slug (creator code) that matched.

  • active (bool) – Whether or not the creator code is active or not.

  • verified (bool) – Whether or not the creator code is verified or not.

async add()

This function is a coroutine.

Sends a friendship request to this user or adds them if they have already sent one to the client.

Raises:
  • NotFound – The specified user does not exist.

  • DuplicateFriendship – The client is already friends with this user.

  • FriendshipRequestAlreadySent – The client has already sent a friendship request that has not been handled yet by the user.

  • MaxFriendshipsExceeded – The client has hit the max amount of friendships a user can have at a time. For most accounts this limit is set to 1000 but it could be higher for others.

  • InviteeMaxFriendshipsExceeded – The user you attempted to add has hit the max amount of friendships a user can have at a time.

  • InviteeMaxFriendshipRequestsExceeded – The user you attempted to add has hit the max amount of friendship requests a user can have at a time. This is usually 700 total requests.

  • Forbidden – The client is not allowed to send friendship requests to the user because of the users settings.

  • HTTPException – An error occurred while requesting to add this friend.

async block()

This function is a coroutine.

Blocks this user.

Raises:

HTTPException – Something went wrong while blocking this user.

property disabled

Whether or not this users account is disabled, meaning they cannot login. Other attributes/functions may not work properly if this is true.

Type:

bool

property display_name

The users displayname

Warning

The display name will be the one registered to the epicgames account. If an epicgames account is not found it defaults to the display name of an external auth.

Warning

This property might be None if Client.fetch_user_data_in_events is set to False.

Type:

Optional[str]

property epicgames_account

Tells you if the user is an account registered to epicgames services. False if the user is from another platform without having linked their account to an epicgames account.

Warning

If this is True, the display name will be the one registered to the epicgames account, if not it defaults to the display name of an external auth.

Warning

This property might be False even though the account is a registered epic games account if Client.fetch_user_data_in_events is set to False.

Type:

bool

property external_auths

List containing information about external auths. Might be empty if the user does not have any external auths.

Type:

List[ExternalAuth]

async fetch()

This function is a coroutine.

Fetches basic information about this user and sets the updated properties. This might be useful if you for example need to be sure the display name is updated or if you have Client.fetch_user_data_in_events set to False.

Raises:

HTTPException – An error occurred while requesting.

async fetch_battlepass_level(*, season, start_time=None, end_time=None)

This function is a coroutine.

Fetches the user’s battlepass level.

Parameters:
  • season (BattlePassStat) –

    The season enum to request the battlepass level for.

    Warning

    If you are requesting the previous season and the new season has not been added to the library yet (check Season), you have to manually include the previous season’s end timestamp in epoch seconds.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The user’s battlepass level. None is returned if the user has not played any real matches this season.

Note

The decimals are the percent progress to the next level. E.g. 208.63 -> Level 208 and 63% on the way to 209.

Return type:

Optional[float]

async fetch_br_stats(*, start_time=None, end_time=None)

This function is a coroutine.

Fetches the user’s stats.

Parameters:
  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden – The user has chosen to be hidden from public stats by disabling the Fortnite setting below. Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats for this user.

Return type:

StatsV2

async fetch_br_stats_collection(collection, start_time=None, end_time=None)

This function is a coroutine.

Fetches a stats collection for this user.

Parameters:
  • collection (StatsCollectionType) – The collection to receive. Collections are predefined stats that attempt to request specific information.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden – The user has chosen to be hidden from public stats by disabling the Fortnite setting below. Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats collection for this user.

Return type:

StatsCollection

async fetch_event_tokens()

This function is a coroutine.

Fetches this user’s event tokens.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of event tokens.

Return type:

list[str]

async fetch_flag()

This function is a coroutine.

Fetches this user’s flag.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The users flag.

Return type:

Country | None

async fetch_ranked_stats(season=None)

This function is a coroutine.

Fetches this user’s ranked stats, currently this works for all users even if they have their stats set to private.

Usage:

# get my C5S3 ranked stats
async def get_6v_ranked_stats():
    print(f'Fetching ranked stats for C5S3')

    user = await bot.fetch_user('6v.')
    ranks = await user.fetch_ranked_stats(
        season=rebootpy.Season.C5S3
    )

    for rank in ranks:
        print(f'{rank.ranking_type.name} - {rank.current_division.name}')

# Example output:
# Fetching ranked stats for C5S3
# BATTLE_ROYALE - DIAMOND_2
# ROCKET_RACING - UNRANKED
# ZERO_BUILD - UNREAL
Parameters:

season (Optional[Season]) – The season that you want to get ranks from. If not provided, it will get the current season’s ranked tracks automatically. Defaults to None

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of all of the user’s ranks in the requested season.

Return type:

List[CompetitiveRank]

property id

The users id

Type:

str

property jid

The JID of the user.

Type:

aioxmpp.JID

Friend

class rebootpy.Friend[source]

Represents a friend on Fortnite

property favorite

True if the friend is favorited by ClientUser else False.

Type:

bool

property nickname

The friend’s nickname. None if no nickname is set for this friend.

Type:

str

property note

The friend’s note. None if no note is set.

Type:

str

property last_presence

The last presence retrieved by the friend. Might be None if no presence has been received by this friend yet.

Type:

Presence

property last_logout

The UTC time of the last time this friend logged off. None if this friend has never logged into fortnite or because the friend was added after the client was started. If the latter is the case, you can fetch the friends last logout with Friend.fetch_last_logout().

Type:

datetime.datetime

property platform

The platform the friend is currently online on. None if the friend is offline.

Type:

Platform

is_online()[source]

Method to check if a user is currently online.

Warning

This method uses the last received presence from this user to determine if the friend is online or not. Therefore, this method will most likely not return True when calling it in event_friend_add(). You could use Client.wait_for() to wait for the presence to be received but remember that if the friend is in fact offline, no presence will be received. You can add a timeout the method to make sure it won’t wait forever.

Returns:

True if the friend is currently online else False.

Return type:

bool

async wait_until_online()[source]

This function is a coroutine.

Waits until this friend comes online. Returns instantly if already online.

async wait_until_offline()[source]

This function is a coroutine.

Waits until this friend goes offline. Returns instantly if already offline.

async fetch_last_logout()[source]

This function is a coroutine.

Fetches the last time this friend logged out.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The last UTC datetime of this friends last logout. Could be None if the friend has never logged into fortnite.

Return type:

Optional[datetime.datetime]

async fetch_mutual_friends()[source]

This function is a coroutine.

Fetches a list of friends you and this friend have in common.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of friends you and this friend have in common.

Return type:

List[Friend]

async set_nickname(nickname)[source]

This function is a coroutine.

Sets the nickname of this friend.

Parameters:

nickname (str) –

The nickname you want to set.
Min length: 3
Max length: 16

Raises:
  • ValueError – The nickname contains too few/many characters or contains invalid characters.

  • HTTPException – An error occurred while requesting.

async remove_nickname()[source]

This function is a coroutine.

Removes the friend’s nickname.

Raises:

HTTPException – An error occurred while requesting.

async set_note(note)[source]

This function is a coroutine.

Pins a note to this friend.

Parameters note: str

The note you want to set.
Min length: 3
Max length: 255
Raises:
  • ValueError – The note contains too few/many characters or contains invalid characters.

  • HTTPException – An error occurred while requesting.

async remove_note()[source]

This function is a coroutine.

Removes the friend’s note.

Raises:

HTTPException – An error occurred while requesting.

async remove()[source]

This function is a coroutine.

Removes the friend from your friendlist.

Raises:

HTTPException – Something went wrong when trying to remove this friend.

async send(content)[source]

This function is a coroutine.

Sends a FriendMessage to this friend.

Parameters:

content (str) – The content of the message, up to 256 characters.

Raises:

ChatError – Content is longer than 256 characters.

async join_party()[source]

This function is a coroutine.

Attempts to join this friends’ party.

Raises:
  • PartyError – Party was not found.

  • Forbidden – The party you attempted to join was private.

  • HTTPException – Something else went wrong when trying to join the party.

Returns:

The clients new party.

Return type:

ClientParty

async invite()[source]

This function is a coroutine.

Invites this friend to your party.

Raises:
Returns:

Object representing the sent party invitation.

Return type:

SentPartyInvitation

async request_to_join()[source]

This function is a coroutine.

Sends a request to join a friends party. This is mainly used for requesting to join private parties specifically, but it can be used for all types of party privacies.

Warning

If the request is accepted by the receiving friend, the bot will receive a regular party invitation. Unlike the fortnite client, rebootpy will not automatically accept this invitation. You have to make some logic for doing that yourself.

Raises:
async owns_offer(offer_id)[source]

This function is a coroutine.

Checks if a friend owns a currently active offer in the item shop.

Raises:
  • InvalidOffer – An invalid/outdated offer_id was passed. Only offers currently in the item shop are valid.

  • HTTPException – An error occurred while requesting.

Returns:

Whether or not the friend owns the offer.

Return type:

bool

async fetch_avatar()[source]

This function is a coroutine.

Fetches this friend’s avatar.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The avatar of the friend.

Return type:

Avatar

async block()

This function is a coroutine.

Blocks this friend.

Raises:

HTTPException – Something went wrong when trying to block this user.

property created_at

The UTC time of when the friendship was created.

Type:

datetime.datetime

property disabled

Whether or not this users account is disabled, meaning they cannot login. Other attributes/functions may not work properly if this is true.

Type:

bool

property display_name

The users displayname

Warning

The display name will be the one registered to the epicgames account. If an epicgames account is not found it defaults to the display name of an external auth.

Warning

This property might be None if Client.fetch_user_data_in_events is set to False.

Type:

Optional[str]

property epicgames_account

Tells you if the user is an account registered to epicgames services. False if the user is from another platform without having linked their account to an epicgames account.

Warning

If this is True, the display name will be the one registered to the epicgames account, if not it defaults to the display name of an external auth.

Warning

This property might be False even though the account is a registered epic games account if Client.fetch_user_data_in_events is set to False.

Type:

bool

property external_auths

List containing information about external auths. Might be empty if the user does not have any external auths.

Type:

List[ExternalAuth]

async fetch()

This function is a coroutine.

Fetches basic information about this user and sets the updated properties. This might be useful if you for example need to be sure the display name is updated or if you have Client.fetch_user_data_in_events set to False.

Raises:

HTTPException – An error occurred while requesting.

async fetch_battlepass_level(*, season, start_time=None, end_time=None)

This function is a coroutine.

Fetches the user’s battlepass level.

Parameters:
  • season (BattlePassStat) –

    The season enum to request the battlepass level for.

    Warning

    If you are requesting the previous season and the new season has not been added to the library yet (check Season), you have to manually include the previous season’s end timestamp in epoch seconds.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The user’s battlepass level. None is returned if the user has not played any real matches this season.

Note

The decimals are the percent progress to the next level. E.g. 208.63 -> Level 208 and 63% on the way to 209.

Return type:

Optional[float]

async fetch_br_stats(*, start_time=None, end_time=None)

This function is a coroutine.

Fetches the user’s stats.

Parameters:
  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden – The user has chosen to be hidden from public stats by disabling the Fortnite setting below. Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats for this user.

Return type:

StatsV2

async fetch_br_stats_collection(collection, start_time=None, end_time=None)

This function is a coroutine.

Fetches a stats collection for this user.

Parameters:
  • collection (StatsCollectionType) – The collection to receive. Collections are predefined stats that attempt to request specific information.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden – The user has chosen to be hidden from public stats by disabling the Fortnite setting below. Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats collection for this user.

Return type:

StatsCollection

async fetch_event_tokens()

This function is a coroutine.

Fetches this user’s event tokens.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of event tokens.

Return type:

list[str]

async fetch_flag()

This function is a coroutine.

Fetches this user’s flag.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The users flag.

Return type:

Country | None

async fetch_ranked_stats(season=None)

This function is a coroutine.

Fetches this user’s ranked stats, currently this works for all users even if they have their stats set to private.

Usage:

# get my C5S3 ranked stats
async def get_6v_ranked_stats():
    print(f'Fetching ranked stats for C5S3')

    user = await bot.fetch_user('6v.')
    ranks = await user.fetch_ranked_stats(
        season=rebootpy.Season.C5S3
    )

    for rank in ranks:
        print(f'{rank.ranking_type.name} - {rank.current_division.name}')

# Example output:
# Fetching ranked stats for C5S3
# BATTLE_ROYALE - DIAMOND_2
# ROCKET_RACING - UNRANKED
# ZERO_BUILD - UNREAL
Parameters:

season (Optional[Season]) – The season that you want to get ranks from. If not provided, it will get the current season’s ranked tracks automatically. Defaults to None

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of all of the user’s ranks in the requested season.

Return type:

List[CompetitiveRank]

property id

The users id

Type:

str

property inbound

True if this friend was the one to send the friend request else False`. Aliased to ``inbound as well.

Type:

bool

property incoming

True if this friend was the one to send the friend request else False`. Aliased to ``inbound as well.

Type:

bool

property jid

The JID of the user.

Type:

aioxmpp.JID

property outbound

True if the bot was the one to send the friend request else False. Aliased to outbound as well.

Type:

bool

property outgoing

True if the bot was the one to send the friend request else False. Aliased to outbound as well.

Type:

bool

property status

The friends status to the client. E.g. if the friend is friends with the bot it will be ACCEPTED.

Warning

This is not the same as status from presence!

Type:

str

IncomingPendingFriend

class rebootpy.IncomingPendingFriend[source]

Represents an incoming pending friend. This means that the client received the friend request.

async accept()[source]

This function is a coroutine.

Accepts this users’ friend request.

Raises:

HTTPException – Something went wrong when trying to accept this request.

Returns:

Object of the friend you just added.

Return type:

Friend

async decline()[source]

This function is a coroutine.

Declines this users’ friend request.

Raises:

HTTPException – Something went wrong when trying to decline this request.

async block()

This function is a coroutine.

Blocks this friend.

Raises:

HTTPException – Something went wrong when trying to block this user.

property created_at

The UTC time of when the request was created

Type:

datetime.datetime

property disabled

Whether or not this users account is disabled, meaning they cannot login. Other attributes/functions may not work properly if this is true.

Type:

bool

property display_name

The users displayname

Warning

The display name will be the one registered to the epicgames account. If an epicgames account is not found it defaults to the display name of an external auth.

Warning

This property might be None if Client.fetch_user_data_in_events is set to False.

Type:

Optional[str]

property epicgames_account

Tells you if the user is an account registered to epicgames services. False if the user is from another platform without having linked their account to an epicgames account.

Warning

If this is True, the display name will be the one registered to the epicgames account, if not it defaults to the display name of an external auth.

Warning

This property might be False even though the account is a registered epic games account if Client.fetch_user_data_in_events is set to False.

Type:

bool

property external_auths

List containing information about external auths. Might be empty if the user does not have any external auths.

Type:

List[ExternalAuth]

async fetch()

This function is a coroutine.

Fetches basic information about this user and sets the updated properties. This might be useful if you for example need to be sure the display name is updated or if you have Client.fetch_user_data_in_events set to False.

Raises:

HTTPException – An error occurred while requesting.

async fetch_battlepass_level(*, season, start_time=None, end_time=None)

This function is a coroutine.

Fetches the user’s battlepass level.

Parameters:
  • season (BattlePassStat) –

    The season enum to request the battlepass level for.

    Warning

    If you are requesting the previous season and the new season has not been added to the library yet (check Season), you have to manually include the previous season’s end timestamp in epoch seconds.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The user’s battlepass level. None is returned if the user has not played any real matches this season.

Note

The decimals are the percent progress to the next level. E.g. 208.63 -> Level 208 and 63% on the way to 209.

Return type:

Optional[float]

async fetch_br_stats(*, start_time=None, end_time=None)

This function is a coroutine.

Fetches the user’s stats.

Parameters:
  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden – The user has chosen to be hidden from public stats by disabling the Fortnite setting below. Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats for this user.

Return type:

StatsV2

async fetch_br_stats_collection(collection, start_time=None, end_time=None)

This function is a coroutine.

Fetches a stats collection for this user.

Parameters:
  • collection (StatsCollectionType) – The collection to receive. Collections are predefined stats that attempt to request specific information.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden – The user has chosen to be hidden from public stats by disabling the Fortnite setting below. Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats collection for this user.

Return type:

StatsCollection

async fetch_event_tokens()

This function is a coroutine.

Fetches this user’s event tokens.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of event tokens.

Return type:

list[str]

async fetch_flag()

This function is a coroutine.

Fetches this user’s flag.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The users flag.

Return type:

Country | None

async fetch_ranked_stats(season=None)

This function is a coroutine.

Fetches this user’s ranked stats, currently this works for all users even if they have their stats set to private.

Usage:

# get my C5S3 ranked stats
async def get_6v_ranked_stats():
    print(f'Fetching ranked stats for C5S3')

    user = await bot.fetch_user('6v.')
    ranks = await user.fetch_ranked_stats(
        season=rebootpy.Season.C5S3
    )

    for rank in ranks:
        print(f'{rank.ranking_type.name} - {rank.current_division.name}')

# Example output:
# Fetching ranked stats for C5S3
# BATTLE_ROYALE - DIAMOND_2
# ROCKET_RACING - UNRANKED
# ZERO_BUILD - UNREAL
Parameters:

season (Optional[Season]) – The season that you want to get ranks from. If not provided, it will get the current season’s ranked tracks automatically. Defaults to None

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of all of the user’s ranks in the requested season.

Return type:

List[CompetitiveRank]

property id

The users id

Type:

str

property inbound

True if this friend was the one to send the friend request else False`. Aliased to ``inbound as well.

Type:

bool

property incoming

True if this friend was the one to send the friend request else False`. Aliased to ``inbound as well.

Type:

bool

property jid

The JID of the user.

Type:

aioxmpp.JID

property outbound

True if the bot was the one to send the friend request else False. Aliased to outbound as well.

Type:

bool

property outgoing

True if the bot was the one to send the friend request else False. Aliased to outbound as well.

Type:

bool

property status

The friends status to the client. E.g. if the friend is friends with the bot it will be ACCEPTED.

Warning

This is not the same as status from presence!

Type:

str

OutgoingPendingFriend

class rebootpy.OutgoingPendingFriend[source]
async cancel()[source]

This function is a coroutine.

Cancel the friend request sent to this user. This method is also aliases to abort().

Raises:

HTTPException – Something went wrong when trying to cancel this request.

async abort()

This function is a coroutine.

Cancel the friend request sent to this user. This method is also aliases to abort().

Raises:

HTTPException – Something went wrong when trying to cancel this request.

async block()

This function is a coroutine.

Blocks this friend.

Raises:

HTTPException – Something went wrong when trying to block this user.

property created_at

The UTC time of when the request was created

Type:

datetime.datetime

property disabled

Whether or not this users account is disabled, meaning they cannot login. Other attributes/functions may not work properly if this is true.

Type:

bool

property display_name

The users displayname

Warning

The display name will be the one registered to the epicgames account. If an epicgames account is not found it defaults to the display name of an external auth.

Warning

This property might be None if Client.fetch_user_data_in_events is set to False.

Type:

Optional[str]

property epicgames_account

Tells you if the user is an account registered to epicgames services. False if the user is from another platform without having linked their account to an epicgames account.

Warning

If this is True, the display name will be the one registered to the epicgames account, if not it defaults to the display name of an external auth.

Warning

This property might be False even though the account is a registered epic games account if Client.fetch_user_data_in_events is set to False.

Type:

bool

property external_auths

List containing information about external auths. Might be empty if the user does not have any external auths.

Type:

List[ExternalAuth]

async fetch()

This function is a coroutine.

Fetches basic information about this user and sets the updated properties. This might be useful if you for example need to be sure the display name is updated or if you have Client.fetch_user_data_in_events set to False.

Raises:

HTTPException – An error occurred while requesting.

async fetch_battlepass_level(*, season, start_time=None, end_time=None)

This function is a coroutine.

Fetches the user’s battlepass level.

Parameters:
  • season (BattlePassStat) –

    The season enum to request the battlepass level for.

    Warning

    If you are requesting the previous season and the new season has not been added to the library yet (check Season), you have to manually include the previous season’s end timestamp in epoch seconds.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The user’s battlepass level. None is returned if the user has not played any real matches this season.

Note

The decimals are the percent progress to the next level. E.g. 208.63 -> Level 208 and 63% on the way to 209.

Return type:

Optional[float]

async fetch_br_stats(*, start_time=None, end_time=None)

This function is a coroutine.

Fetches the user’s stats.

Parameters:
  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden – The user has chosen to be hidden from public stats by disabling the Fortnite setting below. Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats for this user.

Return type:

StatsV2

async fetch_br_stats_collection(collection, start_time=None, end_time=None)

This function is a coroutine.

Fetches a stats collection for this user.

Parameters:
  • collection (StatsCollectionType) – The collection to receive. Collections are predefined stats that attempt to request specific information.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden – The user has chosen to be hidden from public stats by disabling the Fortnite setting below. Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats collection for this user.

Return type:

StatsCollection

async fetch_event_tokens()

This function is a coroutine.

Fetches this user’s event tokens.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of event tokens.

Return type:

list[str]

async fetch_flag()

This function is a coroutine.

Fetches this user’s flag.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The users flag.

Return type:

Country | None

async fetch_ranked_stats(season=None)

This function is a coroutine.

Fetches this user’s ranked stats, currently this works for all users even if they have their stats set to private.

Usage:

# get my C5S3 ranked stats
async def get_6v_ranked_stats():
    print(f'Fetching ranked stats for C5S3')

    user = await bot.fetch_user('6v.')
    ranks = await user.fetch_ranked_stats(
        season=rebootpy.Season.C5S3
    )

    for rank in ranks:
        print(f'{rank.ranking_type.name} - {rank.current_division.name}')

# Example output:
# Fetching ranked stats for C5S3
# BATTLE_ROYALE - DIAMOND_2
# ROCKET_RACING - UNRANKED
# ZERO_BUILD - UNREAL
Parameters:

season (Optional[Season]) – The season that you want to get ranks from. If not provided, it will get the current season’s ranked tracks automatically. Defaults to None

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of all of the user’s ranks in the requested season.

Return type:

List[CompetitiveRank]

property id

The users id

Type:

str

property inbound

True if this friend was the one to send the friend request else False`. Aliased to ``inbound as well.

Type:

bool

property incoming

True if this friend was the one to send the friend request else False`. Aliased to ``inbound as well.

Type:

bool

property jid

The JID of the user.

Type:

aioxmpp.JID

property outbound

True if the bot was the one to send the friend request else False. Aliased to outbound as well.

Type:

bool

property outgoing

True if the bot was the one to send the friend request else False. Aliased to outbound as well.

Type:

bool

property status

The friends status to the client. E.g. if the friend is friends with the bot it will be ACCEPTED.

Warning

This is not the same as status from presence!

Type:

str

FriendMessage

Methods
class rebootpy.FriendMessage[source]
async reply(content)[source]

This function is a coroutine.

Replies to the message with the given content.

Parameters:

content (str) – The content of the message, up to 256 characters.

Raises:

ChatError – Content is longer than 256 characters.

property author

The author of the message.

Type:

Friend

property client

The client.

Type:

Client

property content

The content of the message.

Type:

str

property created_at

The time of when this message was received in UTC.

Type:

datetime.datetime

PartyMessage

Methods
class rebootpy.PartyMessage[source]
property author

The author of a message.

Type:

PartyMember

async reply(content)[source]

This function is a coroutine.

Replies to the message with the given content.

Parameters:

content (str) – The content of the message, up to 256 characters.

Raises:

ChatError – Content is longer than 256 characters or the client is in a party on its own.

property client

The client.

Type:

Client

property content

The content of the message.

Type:

str

property created_at

The time of when this message was received in UTC.

Type:

datetime.datetime

PartyMember

class rebootpy.PartyMember[source]

Represents a party member.

client

The client.

Type:

Client

async kick()[source]

This function is a coroutine.

Kicks this member from the party.

Raises:
  • Forbidden – You are not the leader of the party.

  • PartyError – You attempted to kick yourself.

  • HTTPException – Something else went wrong when trying to kick this member.

async promote()[source]

This function is a coroutine.

Promotes this user to partyleader.

Raises:
  • Forbidden – You are not the leader of the party.

  • PartyError – You are already partyleader.

  • HTTPException – Something else went wrong when trying to promote this member.

async swap_position()[source]

This function is a coroutine.

Swaps the clients party position with this member.

Raises:

HTTPException – An error occurred while requesting.

async add()

This function is a coroutine.

Sends a friendship request to this user or adds them if they have already sent one to the client.

Raises:
  • NotFound – The specified user does not exist.

  • DuplicateFriendship – The client is already friends with this user.

  • FriendshipRequestAlreadySent – The client has already sent a friendship request that has not been handled yet by the user.

  • MaxFriendshipsExceeded – The client has hit the max amount of friendships a user can have at a time. For most accounts this limit is set to 1000 but it could be higher for others.

  • InviteeMaxFriendshipsExceeded – The user you attempted to add has hit the max amount of friendships a user can have at a time.

  • InviteeMaxFriendshipRequestsExceeded – The user you attempted to add has hit the max amount of friendship requests a user can have at a time. This is usually 700 total requests.

  • Forbidden – The client is not allowed to send friendship requests to the user because of the users settings.

  • HTTPException – An error occurred while requesting to add this friend.

property backpack

The BID of the backpack this member currently has equipped. None if no backpack is equipped.

Type:

str

property backpack_variants

A list containing the raw variants data for the currently equipped backpack.

Warning

Variants doesn’t seem to follow much logic. Therefore this returns the raw variants data received from fortnite’s service. This can be directly passed with the variants keyword to ClientPartyMember.set_backpack().

Type:

list

property banner

A tuple consisting of the icon id, color id and the season level.

Example output:

('standardbanner1', 'defaultcolor1')
Type:

tuple

property battlepass_info

A tuple consisting of has purchased and battlepass level.

Example output:

(True, 30)
Type:

tuple

async block()

This function is a coroutine.

Blocks this user.

Raises:

HTTPException – Something went wrong while blocking this user.

property contrail

The contrail id of the contrail this member currently has equipped.

Type:

str

property contrail_variants

A list containing the raw variants data for the currently equipped contrail.

Warning

Variants doesn’t seem to follow much logic. Therefore this returns the raw variants data received from fortnite’s service. This can be directly passed with the variants keyword to ClientPartyMember.set_contrail().

Type:

list

static create_variant(*, config_overrides={}, **kwargs)

Creates the variants list by the variants you set.

Warning

This function is built upon data received from only some of the available outfits with variants. There is little logic behind the variants function therefore there might be some unexpected issues with this function. Please report such issues by creating an issue on the issue tracker or by reporting it to me on discord.

Example usage:

# set the outfit to soccer skin with Norwegian jersey and
# the jersey number set to 99 (max number).
async def set_soccer_skin():
    me = client.party.me

    variants = me.create_variant(
        pattern=0,
        numeric=99,
        jersey_color='Norway'
    )

    await me.set_outfit(
        asset='CID_149_Athena_Commando_F_SoccerGirlB',
        variants=variants
    )
Parameters:
  • config_overrides (Dict[str, str]) –

    A config that overrides the default config for the variant backend names. Example:

    # NOTE: Keys refer to the kwarg name.
    # NOTE: Values must include exactly one empty format bracket.
    {
        'particle': 'Mat{}'
    }
    

  • pattern (Optional[int]) – The pattern number you want to use.

  • numeric (Optional[int]) – The numeric number you want to use.

  • clothing_color (Optional[int]) – The clothing color you want to use.

  • jersey_color (Optional[str]) – The jersey color you want to use. For soccer skins this is the country you want the jersey to represent.

  • parts (Optional[int]) – The parts number you want to use.

  • progressive (Optional[int]) – The progressing number you want to use.

  • particle (Optional[int]) – The particle number you want to use.

  • material (Optional[int]) – The material number you want to use.

  • emissive (Optional[int]) – The emissive number you want to use.

  • profile_banner (Optional[str]) – The profile banner to use. The value should almost always be ProfileBanner.

Returns:

List of dictionaries including all variants data.

Return type:

List[dict]

static create_variants(*, config_overrides={}, **kwargs)

Creates the variants list by the variants you set.

Warning

This function is built upon data received from only some of the available outfits with variants. There is little logic behind the variants function therefore there might be some unexpected issues with this function. Please report such issues by creating an issue on the issue tracker or by reporting it to me on discord.

Example usage:

# set the outfit to soccer skin with Norwegian jersey and
# the jersey number set to 99 (max number).
async def set_soccer_skin():
    me = client.party.me

    variants = me.create_variant(
        pattern=0,
        numeric=99,
        jersey_color='Norway'
    )

    await me.set_outfit(
        asset='CID_149_Athena_Commando_F_SoccerGirlB',
        variants=variants
    )
Parameters:
  • config_overrides (Dict[str, str]) –

    A config that overrides the default config for the variant backend names. Example:

    # NOTE: Keys refer to the kwarg name.
    # NOTE: Values must include exactly one empty format bracket.
    {
        'particle': 'Mat{}'
    }
    

  • pattern (Optional[int]) – The pattern number you want to use.

  • numeric (Optional[int]) – The numeric number you want to use.

  • clothing_color (Optional[int]) – The clothing color you want to use.

  • jersey_color (Optional[str]) – The jersey color you want to use. For soccer skins this is the country you want the jersey to represent.

  • parts (Optional[int]) – The parts number you want to use.

  • progressive (Optional[int]) – The progressing number you want to use.

  • particle (Optional[int]) – The particle number you want to use.

  • material (Optional[int]) – The material number you want to use.

  • emissive (Optional[int]) – The emissive number you want to use.

  • profile_banner (Optional[str]) – The profile banner to use. The value should almost always be ProfileBanner.

Returns:

List of dictionaries including all variants data.

Return type:

List[dict]

property disabled

Whether or not this users account is disabled, meaning they cannot login. Other attributes/functions may not work properly if this is true.

Type:

bool

property display_name

The users displayname

Warning

The display name will be the one registered to the epicgames account. If an epicgames account is not found it defaults to the display name of an external auth.

Warning

This property might be None if Client.fetch_user_data_in_events is set to False.

Type:

Optional[str]

property emoji

The ID of the emoji this member is currently playing. None if no emoji is currently playing.

Type:

Optional[str]

property emote

The EID of the emote this member is currently playing. None if no emote is currently playing.

Type:

Optional[str]

property enlightenments

A list of tuples containing the enlightenments of this member.

Type:

List[tuple]

property epicgames_account

Tells you if the user is an account registered to epicgames services. False if the user is from another platform without having linked their account to an epicgames account.

Warning

If this is True, the display name will be the one registered to the epicgames account, if not it defaults to the display name of an external auth.

Warning

This property might be False even though the account is a registered epic games account if Client.fetch_user_data_in_events is set to False.

Type:

bool

property external_auths

List containing information about external auths. Might be empty if the user does not have any external auths.

Type:

List[ExternalAuth]

async fetch()

This function is a coroutine.

Fetches basic information about this user and sets the updated properties. This might be useful if you for example need to be sure the display name is updated or if you have Client.fetch_user_data_in_events set to False.

Raises:

HTTPException – An error occurred while requesting.

async fetch_battlepass_level(*, season, start_time=None, end_time=None)

This function is a coroutine.

Fetches the user’s battlepass level.

Parameters:
  • season (BattlePassStat) –

    The season enum to request the battlepass level for.

    Warning

    If you are requesting the previous season and the new season has not been added to the library yet (check Season), you have to manually include the previous season’s end timestamp in epoch seconds.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The user’s battlepass level. None is returned if the user has not played any real matches this season.

Note

The decimals are the percent progress to the next level. E.g. 208.63 -> Level 208 and 63% on the way to 209.

Return type:

Optional[float]

async fetch_br_stats(*, start_time=None, end_time=None)

This function is a coroutine.

Fetches the user’s stats.

Parameters:
  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden – The user has chosen to be hidden from public stats by disabling the Fortnite setting below. Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats for this user.

Return type:

StatsV2

async fetch_br_stats_collection(collection, start_time=None, end_time=None)

This function is a coroutine.

Fetches a stats collection for this user.

Parameters:
  • collection (StatsCollectionType) – The collection to receive. Collections are predefined stats that attempt to request specific information.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden – The user has chosen to be hidden from public stats by disabling the Fortnite setting below. Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats collection for this user.

Return type:

StatsCollection

async fetch_event_tokens()

This function is a coroutine.

Fetches this user’s event tokens.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of event tokens.

Return type:

list[str]

async fetch_flag()

This function is a coroutine.

Fetches this user’s flag.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The users flag.

Return type:

Country | None

async fetch_ranked_stats(season=None)

This function is a coroutine.

Fetches this user’s ranked stats, currently this works for all users even if they have their stats set to private.

Usage:

# get my C5S3 ranked stats
async def get_6v_ranked_stats():
    print(f'Fetching ranked stats for C5S3')

    user = await bot.fetch_user('6v.')
    ranks = await user.fetch_ranked_stats(
        season=rebootpy.Season.C5S3
    )

    for rank in ranks:
        print(f'{rank.ranking_type.name} - {rank.current_division.name}')

# Example output:
# Fetching ranked stats for C5S3
# BATTLE_ROYALE - DIAMOND_2
# ROCKET_RACING - UNRANKED
# ZERO_BUILD - UNREAL
Parameters:

season (Optional[Season]) – The season that you want to get ranks from. If not provided, it will get the current season’s ranked tracks automatically. Defaults to None

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of all of the user’s ranks in the requested season.

Return type:

List[CompetitiveRank]

property has_crown

If this member currently has a crown or not.

Type:

int

property hidden

Whether or not the member is currently hidden in the party. A member can only be hidden if a bot is the leader, therefore this attribute rarely is used.

Type:

bool

property id

The users id

Type:

str

in_match()

Whether or not this member is currently in a match.

Returns:

True if this member is in a match else False.

Return type:

bool

property input

The input type this user is currently using.

Type:

str

is_ready()

Whether or not this member is ready.

Returns:

True if this member is ready else False.

Return type:

bool

is_zombie()

bool: Whether or not this member is in a zombie mode meaning their xmpp connection is disconnected and not responding.

property jam

The SparksSongPart of the jam this member is currently playing. None if no jam is currently playing.

Type:

Optional[str]

property jid

The JID of the user.

Type:

aioxmpp.JID

property joined_at

The UTC time of when this member joined its party.

Type:

datetime.datetime

property kicks

The kicks id of the kicks this member currently has equipped.

Type:

str

property kicks_variants

A list containing the raw variants data for the currently equipped kicks.

Warning

Variants doesn’t seem to follow much logic. Therefore this returns the raw variants data received from fortnite’s service. This can be directly passed with the variants keyword to ClientPartyMember.set_kicks().

Type:

list

property leader

Returns True if member is the leader else False.

Type:

bool

property lobby_map_marker_coordinates

A tuple containing the x and y coordinates of this members current lobby map marker.

Note

Check if the marker is currently visible with PartyMember.lobby_map_marker_is_visible().

Note

The coordinates range is roughly -135000.0 <= coordinate <= 135000

Type:

Tuple[float, float]

lobby_map_marker_is_visible()

Whether or not this members lobby map marker is currently visible.

Returns:

True if this members lobby map marker is currently visible else False.

Return type:

bool

property match_players_left

How many players there are left in this players match.

Returns:

How many players there are left in this members current match. Defaults to 0 if not in a match.

Return type:

int

property match_started_at

The time in UTC that the members match started. None if not in a match.

Type:

Optional[datetime.datetime]

property matchmaking_info

The members matchmaking info.

Type:

:dict:`MatchmakingInfo`

property offline_ttl

The amount of time this member will stay in a zombie mode before expiring.

Type:

int

property outfit

The CID of the outfit this user currently has equipped.

Type:

str

property outfit_variants

A list containing the raw variants data for the currently equipped outfit.

Warning

Variants doesn’t seem to follow much logic. Therefore this returns the raw variants data received from fortnite’s service. This can be directly passed with the variants keyword to ClientPartyMember.set_outfit().

Type:

list

property party

The party this member is a part of.

Type:

Union[Party, ClientParty]

property pet

The ID of the pet this member currently has equipped. None if no pet is equipped.

Type:

str

property pickaxe

The pickaxe id of the pickaxe this member currently has equipped.

Type:

str

property pickaxe_variants

A list containing the raw variants data for the currently equipped pickaxe.

Warning

Variants doesn’t seem to follow much logic. Therefore this returns the raw variants data received from fortnite’s service. This can be directly passed with the variants keyword to ClientPartyMember.set_pickaxe().

Type:

list

property platform

The platform this user currently uses.

Type:

Platform

property playlist_selection

The last playlist that this member selected (the most recently selected playlist of all members is what the game decides to be the current playlist of the party).

Example output: experience_reload

Type:

str

property position

Returns this members position in the party. This position is what defines which team you’re apart of in the party. The position can be any number from 0-15 (16 in total).

0-3 = Team 1
4-7 = Team 2
8-11 = Team 3
12-15 = Team 4
Type:

int

property power_level

This members STW power level, may be off by 1.

Type:

int

property rank

The current rank of this member.

Warning

This is pretty inaccurate now as there are multiple ranked modes, so you’d need to check what the current set playlist is to even figure out what mode this rank is for. I’d recommend just using PartyMember.fetch_ranked_stats() instead which works for any users even if they have their stats set to private.

Type:

int

property ready

The members ready state.

Type:

ReadyState

property scratchpad

The scratchpad data this member currently has.

Type:

str

property sidekick

The sidekick id of the sidekick this member currently has equipped.

Type:

str

property sidekick_variants

A list containing the raw variants data for the currently equipped sidekick.

Warning

Variants doesn’t seem to follow much logic. Therefore this returns the raw variants data received from fortnite’s service. This can be directly passed with the variants keyword to ClientPartyMember.set_sidekick().

Type:

list

property victory_crowns

The current crown wins of this member.

Type:

int

property will_yield_leadership

Whether or not this member will promote another member as soon as there is a chance for it. This is usually only True for Just Chattin’ members.

Type:

bool

property zombie_since

The utc datetime this member went into a zombie state. None if this user is currently not a zombie.

Type:

Optional[datetime.datetime]

ClientPartyMember

class rebootpy.ClientPartyMember[source]

Represents the clients party member.

client

The client.

Type:

Client

async edit(*coros)[source]

This function is a coroutine.

Edits multiple meta parts at once.

This example sets the clients outfit to galaxy and banner to the epic banner with level 100:

from functools import partial

async def edit_client_member():
    member = client.party.me
    await member.edit(
        member.set_outfit('CID_175_Athena_Commando_M_Celestial'), # usage with non-awaited coroutines
        partial(member.set_banner, icon="OtherBanner28", season_level=100) # usage with functools.partial()
    )
Parameters:

*coros (Union[asyncio.coroutine, functools.partial]) – A list of coroutines that should be included in the edit.

Raises:

HTTPException – Something went wrong while editing.

async edit_and_keep(*coros)[source]

This function is a coroutine.

Edits multiple meta parts at once and keeps the changes for when the bot joins other parties.

This example sets the clients outfit to galaxy and banner to the epic banner with level 100. When the client joins another party, the outfit and banner will automatically be equipped:

from functools import partial

async def edit_and_keep_client_member():
    member = client.party.me
    await member.edit_and_keep(
        partial(member.set_outfit, 'CID_175_Athena_Commando_M_Celestial'),
        partial(member.set_banner, icon="OtherBanner28", season_level=100)
    )
Parameters:

*coros (functools.partial) – A list of coroutines that should be included in the edit. Unlike ClientPartyMember.edit(), this method only takes coroutines in the form of a functools.partial.

Raises:

HTTPException – Something went wrong while editing.

async leave()[source]

This function is a coroutine.

Leaves the party.

Raises:

HTTPException – An error occurred while requesting to leave the party.

Returns:

The new party the client is connected to after leaving.

Return type:

ClientParty

async set_ready(state)[source]

This function is a coroutine.

Sets the readiness of the client.

Parameters:

state (ReadyState) – The ready state you wish to set.

async set_outfit(asset=None, *, variants=None, enlightenment=None, corruption=None)[source]

This function is a coroutine.

Sets the outfit of the client.

Parameters:
  • asset (Optional[str]) –

    The CID of the outfit.
    Defaults to the last set outfit.

    Note

    You don’t have to include the full path of the asset. The CID is enough.

  • key (Optional[str]) – The encryption key to use for this skin.

  • variants (Optional[list]) – The variants to use for this outfit. Defaults to None which resets variants.

  • enlightenment (Optional[Union[list, Tuple]]) –

    A list/tuple containing exactly two integer values describing the season and the level you want to enlighten the current loadout with.

    Note

    Using enlightenments often requires you to set a specific variant for the skin.

    Example.:

    # First value is the season in Fortnite Chapter 2
    # Second value is the level for the season
    (1, 300)
    

  • corruption (Optional[float]) –

    The corruption value to use for the loadout.

    Note

    Unlike enlightenment you do not need to set any variants yourself as that is handled by the library.

Raises:

HTTPException – An error occurred while requesting.

async set_backpack(asset=None, *, variants=None, enlightenment=None, corruption=None)[source]

This function is a coroutine.

Sets the backpack of the client.

Parameters:

asset (Optional[str]) –

The BID of the backpack.
Defaults to the last set backpack.

key: Optional[str]

The encryption key to use for this backpack.

variants: Optional[list]

The variants to use for this backpack. Defaults to None which resets variants.

enlightenment: Optional[Union[list, Tuple]]

A list/tuple containing exactly two integer values describing the season and the level you want to enlighten the current loadout with.

Note

Using enlightenments often requires you to set a specific variant for the skin.

Example.:

# First value is the season in Fortnite Chapter 2
# Second value is the level for the season
(1, 300)
corruption: Optional[float]

The corruption value to use for the loadout.

Note

Unlike enlightenment you do not need to set any variants yourself as that is handled by the library.

Raises:

HTTPException – An error occurred while requesting.

async clear_backpack()[source]

This function is a coroutine.

Clears the currently set backpack.

Raises:

HTTPException – An error occurred while requesting.

async set_pet(asset=None, *, variants=None)[source]

This function is a coroutine.

Sets the pet of the client.

Parameters:

asset (Optional[str]) –

The ID of the pet.
Defaults to the last set pet.

key: Optional[str]

The encryption key to use for this pet.

variants: Optional[list]

The variants to use for this pet. Defaults to None which resets variants.

Raises:

HTTPException – An error occurred while requesting.

async clear_pet()[source]

This function is a coroutine.

Clears the currently set pet.

Raises:

HTTPException – An error occurred while requesting.

async set_pickaxe(asset=None, *, variants=None)[source]

This function is a coroutine.

Sets the pickaxe of the client.

Parameters:

asset (Optional[str]) –

The PID of the pickaxe.
Defaults to the last set pickaxe.

key: Optional[str]

The encryption key to use for this pickaxe.

variants: Optional[list]

The variants to use for this pickaxe. Defaults to None which resets variants.

Raises:

HTTPException – An error occurred while requesting.

async set_contrail(asset=None, *, variants=None)[source]

This function is a coroutine.

Sets the contrail of the client.

Parameters:

asset (Optional[str]) –

The ID of the contrail.
Defaults to the last set contrail.

key: Optional[str]

The encryption key to use for this contrail.

variants: Optional[list]

The variants to use for this contrail. Defaults to None which resets variants.

Raises:

HTTPException – An error occurred while requesting.

async set_kicks(asset=None, *, key=None, variants=None)[source]

This function is a coroutine.

Sets the kicks (shoes) of the client.

Parameters:

asset (Optional[str]) –

The ID of the kicks.
Defaults to the last set of kicks.

key: Optional[str]

The encryption key to use for these kicks.

Raises:

HTTPException – An error occurred while requesting.

async clear_kicks()[source]

This function is a coroutine.

Clears the currently set kicks.

Raises:

HTTPException – An error occurred while requesting.

async set_sidekick(asset=None, *, variants=None)[source]

This function is a coroutine.

Sets the sidekick of the client.

Parameters:

asset (Optional[str]) –

The ID of the sidekick.
Defaults to the last set sidekick.

key: Optional[str]

The encryption key to use for this sidekick.

Raises:

HTTPException – An error occurred while requesting.

async clear_sidekick()[source]

This function is a coroutine.

Clears the currently set sidekick.

Raises:

HTTPException – An error occurred while requesting.

async equip_crown(hold_crown=True)[source]

This function is a coroutine.

Set whether the user is wearing a crown or not.

Parameters:

hold_crown (bool) –

Whether you want the user to wear a crown or not.
Defaults to True.

Raises:

HTTPException – An error occurred while requesting.

async set_victory_crowns(crowns=0)[source]

This function is a coroutine.

Set the amount of victory crowns the user has (must use the ‘Crowning Achievement’ to show).

Parameters:

crowns (int) –

Amount of crowns the user has.
Defaults to 0 to clear crowns.

Raises:

HTTPException – An error occurred while requesting.

async clear_contrail()[source]

This function is a coroutine.

Clears the currently set contrail.

Raises:

HTTPException – An error occurred while requesting.

async set_emote(asset, *, run_for=None, key=None, section=None)[source]

This function is a coroutine.

Sets the emote of the client.

Parameters:

asset (str) – The EID of the emote.

run_for: Optional[float]

Seconds the emote should run for before being cancelled. None (default) means it will run indefinitely and you can then clear it with PartyMember.clear_emote().

key: Optional[str]

The encryption key to use for this emote.

section: Optional[int]

The section.

Raises:

HTTPException – An error occurred while requesting.

async set_jam_emote(asset, *, run_for=None, key=None, section=None)[source]

This function is a coroutine.

Sets the jam emote of the client.

Parameters:
  • asset (str) –

    The EID of the jam emote.

    Note

    If you only have the Jam Track ID of the jawm track you want to play, you can replcae sid with eid and then add either _vox, _drum, _lead or _bass to the end depending on what instrument you want to use. e.g. sid_placeholder_10 becomes sid_placeholder_10_vox.

  • run_for (Optional[float]) –

    Seconds the jam emote should run for before being cancelled.

    None (default) means it will run indefinitely and you can then clear it with PartyMember.clear_emote().

  • key (Optional[str]) – The encryption key to use for this emote.

  • section (Optional[int]) – The section.

Raises:

HTTPException – An error occurred while requesting.

async set_emoji(asset, *, run_for=2, key=None, section=None)[source]

This function is a coroutine.

Sets the emoji of the client.

Parameters:
  • asset (str) – The ID of the emoji.

  • run_for (Optional[float]) – Seconds the emoji should run for before being cancelled. None means it will run indefinitely and you can then clear it with PartyMember.clear_emote(). Defaults to 2 seconds which is roughly the time an emoji naturally plays for. Note that an emoji is only cleared visually and audibly when the emoji naturally ends, not when PartyMember.clear_emote() is called.

  • key (Optional[str]) – The encryption key to use for this emoji.

  • section (Optional[int]) – The section.

Raises:

HTTPException – An error occurred while requesting.

async set_sidekick_emote(asset, run_for=3)[source]

This function is a coroutine.

Sets the emote of your client’s sidekick.

Parameters:
  • asset (str) – The ID of sidekick emote, known values are Emote to dance & Interact to hi-five.

  • run_for (Optional[float]) – Seconds the hi five should run for before being cancelled. None means it will run indefinitely and you can then clear it with PartyMember.clear_sidekick_emote(). Defaults to 2 seconds which is roughly the time a sidekick emote visually plays for. Note that a hi five is only cleared visually and audibly when the hi five naturally ends, not when PartyMember.clear_sidekick_emote() is called.

Raises:

HTTPException – An error occurred while requesting.

async clear_emote()[source]

This function is a coroutine.

Clears/stops the emote currently playing.

Raises:

HTTPException – An error occurred while requesting.

async clear_sidekick_emote()[source]

This function is a coroutine.

Clears/stops the current sidekick emote playing.

Raises:

HTTPException – An error occurred while requesting.

async set_banner(icon=None, color=None)[source]

This function is a coroutine.

Sets the banner of the client.

Parameters:
  • icon (Optional[str]) – The icon to use. Defaults to standardbanner15

  • color (Optional[str]) – The color to use. Defaults to defaultcolor15

Raises:

HTTPException – An error occurred while requesting.

async set_battlepass_info(has_purchased=None, level=None)[source]

This function is a coroutine.

Sets the battlepass info of the client including the clients level.

Parameters:
  • has_purchased (Optional[bool]) – Whether or not you have purchased the battle pass. Defaults to False

  • level (Optional[int]) – Sets the battle pass level (not the shown level). Defaults to 1

Raises:

HTTPException – An error occurred while requesting.

async set_position(position)[source]

This function is a coroutine.

Sets the clients party position.

Parameters:

position (int) – An integer ranging from 0-15. If a position is already held by someone else, then the client and the existing holder will swap positions.

Raises:
async set_in_match()[source]

This function is a coroutine.

Sets the clients party member in a visible match state.

Note

This is only visual in the party and is not a method for joining a match.

Raises:

HTTPException – An error occurred while requesting.

async clear_in_match()[source]

This function is a coroutine.

Clears the clients “in match” state.

Raises:

HTTPException – An error occurred while requesting.

async set_lobby_map_marker(x, y)[source]

This function is a coroutine.

Sets the clients lobby map marker.

Parameters:
  • x (float) – The horizontal x coordinate. The x range is roughly -135000.0 <= x <= 135000.

  • y (float) – The vertical y coordinate. The y range is roughly -135000.0 <= y <= 135000.

Raises:

HTTPException – An error occurred while requesting.

async clear_lobby_map_marker()[source]

This function is a coroutine.

Clears and hides the clients current lobby map marker.

Raises:

HTTPException – An error occurred while requesting.

async set_instruments(bass=None, bass_variants=None, guitar=None, guitar_variants=None, drums=None, drums_variants=None, keytar=None, keytar_variants=None, microphone=None, microphone_variants=None)[source]

This function is a coroutine.

Sets the clients instruments for use in jam emotes.

Parameters:
  • bass (Optional[str]) – The ID of the bass instrument.

  • bass_variants (Optional[dict]) – The raw variants for the bass instrument.

  • guitar (Optional[str]) – The ID of the guitar instrument.

  • guitar_variants (Optional[dict]) – The raw variants for the guitar instrument.

  • drums (Optional[str]) – The ID of the drums instrument.

  • drums_variants (Optional[dict]) – The raw variants for the drums instrument.

  • keytar (Optional[str]) – The ID of the keytar instrument.

  • keytar_variants (Optional[dict]) – The raw variants for the keytar instrument.

  • microphone (Optional[str]) – The ID of the microphone instrument.

  • microphone_variants (Optional[dict]) – The raw variants for the microphone instrument.

Raises:

HTTPException – An error occurred while requesting.

async set_fort_stats(fortitude=None, offense=None, resistance=None, tech=None, team_fortitude=None, team_offense=None, team_resistance=None, team_tech=None, fortitude_phoenix=None, offense_phoenix=None, resistance_phoenix=None, tech_phoenix=None, team_fortitude_phoenix=None, team_offense_phoenix=None, team_resistance_phoenix=None, team_tech_phoenix=None)[source]

This function is a coroutine.

Sets the FORT stats of the client.

Parameters:
  • fortitude (Optional[int]) – The fortitude value to use.

  • offense (Optional[int]) – The offense value to use.

  • resistance (Optional[int]) – The resistance value to use.

  • tech (Optional[int]) – The tech value to use.

  • team_fortitude (Optional[int]) – The team fortitude value to use.

  • team_offense (Optional[int]) – The team offense value to use.

  • team_resistance (Optional[int]) – The team resistance value to use.

  • team_tech (Optional[int]) – The team tech value to use.

  • fortitude_phoenix (Optional[int]) – The phoenix fortitude value to use.

  • offense_phoenix (Optional[int]) – The phoenix offense value to use.

  • resistance_phoenix (Optional[int]) – The phoenix resistance value to use.

  • tech_phoenix (Optional[int]) – The phoenix tech value to use.

  • team_fortitude_phoenix (Optional[int]) – The phoenix team fortitude value to use.

  • team_offense_phoenix (Optional[int]) – The phoenix team offense value to use.

  • team_resistance_phoenix (Optional[int]) – The phoenix team resistance value to use.

  • team_tech_phoenix (Optional[int]) – The phoenix team tech value to use.

Raises:

HTTPException – An error occurred while requesting.

async set_backpack_rating(rating)[source]

This function is a coroutine.

Sets the backpack rating value of the client.

Parameters:

rating (int) – The backpack rating to use.

Raises:

HTTPException – An error occurred while requesting.

async set_hero_loadout_rating(rating)[source]

This function is a coroutine.

Sets the hero loadout rating value of the client.

Parameters:

rating (int) – The hero loadout rating to use.

Raises:

HTTPException – An error occurred while requesting.

async set_power_level(power_level)[source]

This function is a coroutine.

Sets the power level of the client.

Parameters:

power_level (int) – The power level value to use.

Raises:

HTTPException – An error occurred while requesting.

async add()

This function is a coroutine.

Sends a friendship request to this user or adds them if they have already sent one to the client.

Raises:
  • NotFound – The specified user does not exist.

  • DuplicateFriendship – The client is already friends with this user.

  • FriendshipRequestAlreadySent – The client has already sent a friendship request that has not been handled yet by the user.

  • MaxFriendshipsExceeded – The client has hit the max amount of friendships a user can have at a time. For most accounts this limit is set to 1000 but it could be higher for others.

  • InviteeMaxFriendshipsExceeded – The user you attempted to add has hit the max amount of friendships a user can have at a time.

  • InviteeMaxFriendshipRequestsExceeded – The user you attempted to add has hit the max amount of friendship requests a user can have at a time. This is usually 700 total requests.

  • Forbidden – The client is not allowed to send friendship requests to the user because of the users settings.

  • HTTPException – An error occurred while requesting to add this friend.

property backpack

The BID of the backpack this member currently has equipped. None if no backpack is equipped.

Type:

str

property backpack_variants

A list containing the raw variants data for the currently equipped backpack.

Warning

Variants doesn’t seem to follow much logic. Therefore this returns the raw variants data received from fortnite’s service. This can be directly passed with the variants keyword to ClientPartyMember.set_backpack().

Type:

list

property banner

A tuple consisting of the icon id, color id and the season level.

Example output:

('standardbanner1', 'defaultcolor1')
Type:

tuple

property battlepass_info

A tuple consisting of has purchased and battlepass level.

Example output:

(True, 30)
Type:

tuple

async block()

This function is a coroutine.

Blocks this user.

Raises:

HTTPException – Something went wrong while blocking this user.

property contrail

The contrail id of the contrail this member currently has equipped.

Type:

str

property contrail_variants

A list containing the raw variants data for the currently equipped contrail.

Warning

Variants doesn’t seem to follow much logic. Therefore this returns the raw variants data received from fortnite’s service. This can be directly passed with the variants keyword to ClientPartyMember.set_contrail().

Type:

list

static create_variant(*, config_overrides={}, **kwargs)

Creates the variants list by the variants you set.

Warning

This function is built upon data received from only some of the available outfits with variants. There is little logic behind the variants function therefore there might be some unexpected issues with this function. Please report such issues by creating an issue on the issue tracker or by reporting it to me on discord.

Example usage:

# set the outfit to soccer skin with Norwegian jersey and
# the jersey number set to 99 (max number).
async def set_soccer_skin():
    me = client.party.me

    variants = me.create_variant(
        pattern=0,
        numeric=99,
        jersey_color='Norway'
    )

    await me.set_outfit(
        asset='CID_149_Athena_Commando_F_SoccerGirlB',
        variants=variants
    )
Parameters:
  • config_overrides (Dict[str, str]) –

    A config that overrides the default config for the variant backend names. Example:

    # NOTE: Keys refer to the kwarg name.
    # NOTE: Values must include exactly one empty format bracket.
    {
        'particle': 'Mat{}'
    }
    

  • pattern (Optional[int]) – The pattern number you want to use.

  • numeric (Optional[int]) – The numeric number you want to use.

  • clothing_color (Optional[int]) – The clothing color you want to use.

  • jersey_color (Optional[str]) – The jersey color you want to use. For soccer skins this is the country you want the jersey to represent.

  • parts (Optional[int]) – The parts number you want to use.

  • progressive (Optional[int]) – The progressing number you want to use.

  • particle (Optional[int]) – The particle number you want to use.

  • material (Optional[int]) – The material number you want to use.

  • emissive (Optional[int]) – The emissive number you want to use.

  • profile_banner (Optional[str]) – The profile banner to use. The value should almost always be ProfileBanner.

Returns:

List of dictionaries including all variants data.

Return type:

List[dict]

static create_variants(*, config_overrides={}, **kwargs)

Creates the variants list by the variants you set.

Warning

This function is built upon data received from only some of the available outfits with variants. There is little logic behind the variants function therefore there might be some unexpected issues with this function. Please report such issues by creating an issue on the issue tracker or by reporting it to me on discord.

Example usage:

# set the outfit to soccer skin with Norwegian jersey and
# the jersey number set to 99 (max number).
async def set_soccer_skin():
    me = client.party.me

    variants = me.create_variant(
        pattern=0,
        numeric=99,
        jersey_color='Norway'
    )

    await me.set_outfit(
        asset='CID_149_Athena_Commando_F_SoccerGirlB',
        variants=variants
    )
Parameters:
  • config_overrides (Dict[str, str]) –

    A config that overrides the default config for the variant backend names. Example:

    # NOTE: Keys refer to the kwarg name.
    # NOTE: Values must include exactly one empty format bracket.
    {
        'particle': 'Mat{}'
    }
    

  • pattern (Optional[int]) – The pattern number you want to use.

  • numeric (Optional[int]) – The numeric number you want to use.

  • clothing_color (Optional[int]) – The clothing color you want to use.

  • jersey_color (Optional[str]) – The jersey color you want to use. For soccer skins this is the country you want the jersey to represent.

  • parts (Optional[int]) – The parts number you want to use.

  • progressive (Optional[int]) – The progressing number you want to use.

  • particle (Optional[int]) – The particle number you want to use.

  • material (Optional[int]) – The material number you want to use.

  • emissive (Optional[int]) – The emissive number you want to use.

  • profile_banner (Optional[str]) – The profile banner to use. The value should almost always be ProfileBanner.

Returns:

List of dictionaries including all variants data.

Return type:

List[dict]

property disabled

Whether or not this users account is disabled, meaning they cannot login. Other attributes/functions may not work properly if this is true.

Type:

bool

property display_name

The users displayname

Warning

The display name will be the one registered to the epicgames account. If an epicgames account is not found it defaults to the display name of an external auth.

Warning

This property might be None if Client.fetch_user_data_in_events is set to False.

Type:

Optional[str]

property emoji

The ID of the emoji this member is currently playing. None if no emoji is currently playing.

Type:

Optional[str]

property emote

The EID of the emote this member is currently playing. None if no emote is currently playing.

Type:

Optional[str]

property enlightenments

A list of tuples containing the enlightenments of this member.

Type:

List[tuple]

property epicgames_account

Tells you if the user is an account registered to epicgames services. False if the user is from another platform without having linked their account to an epicgames account.

Warning

If this is True, the display name will be the one registered to the epicgames account, if not it defaults to the display name of an external auth.

Warning

This property might be False even though the account is a registered epic games account if Client.fetch_user_data_in_events is set to False.

Type:

bool

property external_auths

List containing information about external auths. Might be empty if the user does not have any external auths.

Type:

List[ExternalAuth]

async fetch()

This function is a coroutine.

Fetches basic information about this user and sets the updated properties. This might be useful if you for example need to be sure the display name is updated or if you have Client.fetch_user_data_in_events set to False.

Raises:

HTTPException – An error occurred while requesting.

async fetch_battlepass_level(*, season, start_time=None, end_time=None)

This function is a coroutine.

Fetches the user’s battlepass level.

Parameters:
  • season (BattlePassStat) –

    The season enum to request the battlepass level for.

    Warning

    If you are requesting the previous season and the new season has not been added to the library yet (check Season), you have to manually include the previous season’s end timestamp in epoch seconds.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the window to get the battlepass level from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The user’s battlepass level. None is returned if the user has not played any real matches this season.

Note

The decimals are the percent progress to the next level. E.g. 208.63 -> Level 208 and 63% on the way to 209.

Return type:

Optional[float]

async fetch_br_stats(*, start_time=None, end_time=None)

This function is a coroutine.

Fetches the user’s stats.

Parameters:
  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden – The user has chosen to be hidden from public stats by disabling the Fortnite setting below. Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats for this user.

Return type:

StatsV2

async fetch_br_stats_collection(collection, start_time=None, end_time=None)

This function is a coroutine.

Fetches a stats collection for this user.

Parameters:
  • collection (StatsCollectionType) – The collection to receive. Collections are predefined stats that attempt to request specific information.

  • start_time (Optional[Union[int, datetime.datetime]]) – The UTC start time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `start_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.start_timestamp``). Defaults to None.

  • end_time (Optional[Union[int, datetime.datetime]]) – The UTC end time of the time period to get stats from. Must be seconds since epoch, :class:`datetime.datetime`, or the `end_timestamp` value of a :class:`Season` (e.g., ``Season.C5SOG.end_timestamp``). Defaults to None.

Raises:
  • Forbidden – The user has chosen to be hidden from public stats by disabling the Fortnite setting below. Settings -> Account and Privacy -> Show on career     leaderboard

  • HTTPException – An error occurred while requesting.

Returns:

An object representing the stats collection for this user.

Return type:

StatsCollection

async fetch_event_tokens()

This function is a coroutine.

Fetches this user’s event tokens.

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of event tokens.

Return type:

list[str]

async fetch_flag()

This function is a coroutine.

Fetches this user’s flag.

Raises:

HTTPException – An error occurred while requesting.

Returns:

The users flag.

Return type:

Country | None

async fetch_ranked_stats(season=None)

This function is a coroutine.

Fetches this user’s ranked stats, currently this works for all users even if they have their stats set to private.

Usage:

# get my C5S3 ranked stats
async def get_6v_ranked_stats():
    print(f'Fetching ranked stats for C5S3')

    user = await bot.fetch_user('6v.')
    ranks = await user.fetch_ranked_stats(
        season=rebootpy.Season.C5S3
    )

    for rank in ranks:
        print(f'{rank.ranking_type.name} - {rank.current_division.name}')

# Example output:
# Fetching ranked stats for C5S3
# BATTLE_ROYALE - DIAMOND_2
# ROCKET_RACING - UNRANKED
# ZERO_BUILD - UNREAL
Parameters:

season (Optional[Season]) – The season that you want to get ranks from. If not provided, it will get the current season’s ranked tracks automatically. Defaults to None

Raises:

HTTPException – An error occurred while requesting.

Returns:

A list of all of the user’s ranks in the requested season.

Return type:

List[CompetitiveRank]

property has_crown

If this member currently has a crown or not.

Type:

int

property hidden

Whether or not the member is currently hidden in the party. A member can only be hidden if a bot is the leader, therefore this attribute rarely is used.

Type:

bool

property id

The users id

Type:

str

in_match()

Whether or not this member is currently in a match.

Returns:

True if this member is in a match else False.

Return type:

bool

property input

The input type this user is currently using.

Type:

str

is_ready()

Whether or not this member is ready.

Returns:

True if this member is ready else False.

Return type:

bool

is_zombie()

bool: Whether or not this member is in a zombie mode meaning their xmpp connection is disconnected and not responding.

property jam

The SparksSongPart of the jam this member is currently playing. None if no jam is currently playing.

Type:

Optional[str]

property jid

The JID of the user.

Type:

aioxmpp.JID

property joined_at

The UTC time of when this member joined its party.

Type:

datetime.datetime

property kicks

The kicks id of the kicks this member currently has equipped.

Type:

str

property kicks_variants

A list containing the raw variants data for the currently equipped kicks.

Warning

Variants doesn’t seem to follow much logic. Therefore this returns the raw variants data received from fortnite’s service. This can be directly passed with the variants keyword to ClientPartyMember.set_kicks().

Type:

list

property leader

Returns True if member is the leader else False.

Type:

bool

property lobby_map_marker_coordinates

A tuple containing the x and y coordinates of this members current lobby map marker.

Note

Check if the marker is currently visible with PartyMember.lobby_map_marker_is_visible().

Note

The coordinates range is roughly -135000.0 <= coordinate <= 135000

Type:

Tuple[float, float]

lobby_map_marker_is_visible()

Whether or not this members lobby map marker is currently visible.

Returns:

True if this members lobby map marker is currently visible else False.

Return type:

bool

property match_players_left

How many players there are left in this players match.

Returns:

How many players there are left in this members current match. Defaults to 0 if not in a match.

Return type:

int

property match_started_at

The time in UTC that the members match started. None if not in a match.

Type:

Optional[datetime.datetime]

property matchmaking_info

The members matchmaking info.

Type:

:dict:`MatchmakingInfo`

property offline_ttl

The amount of time this member will stay in a zombie mode before expiring.

Type:

int

property outfit

The CID of the outfit this user currently has equipped.

Type:

str

property outfit_variants

A list containing the raw variants data for the currently equipped outfit.

Warning

Variants doesn’t seem to follow much logic. Therefore this returns the raw variants data received from fortnite’s service. This can be directly passed with the variants keyword to ClientPartyMember.set_outfit().

Type:

list

property party

The party this member is a part of.

Type:

Union[Party, ClientParty]

property pet

The ID of the pet this member currently has equipped. None if no pet is equipped.

Type:

str

property pickaxe

The pickaxe id of the pickaxe this member currently has equipped.

Type:

str

property pickaxe_variants

A list containing the raw variants data for the currently equipped pickaxe.

Warning

Variants doesn’t seem to follow much logic. Therefore this returns the raw variants data received from fortnite’s service. This can be directly passed with the variants keyword to ClientPartyMember.set_pickaxe().

Type:

list

property platform

The platform this user currently uses.

Type:

Platform

property playlist_selection

The last playlist that this member selected (the most recently selected playlist of all members is what the game decides to be the current playlist of the party).

Example output: experience_reload

Type:

str

property position

Returns this members position in the party. This position is what defines which team you’re apart of in the party. The position can be any number from 0-15 (16 in total).

0-3 = Team 1
4-7 = Team 2
8-11 = Team 3
12-15 = Team 4
Type:

int

property power_level

This members STW power level, may be off by 1.

Type:

int

property rank

The current rank of this member.

Warning

This is pretty inaccurate now as there are multiple ranked modes, so you’d need to check what the current set playlist is to even figure out what mode this rank is for. I’d recommend just using PartyMember.fetch_ranked_stats() instead which works for any users even if they have their stats set to private.

Type:

int

property ready

The members ready state.

Type:

ReadyState

property scratchpad

The scratchpad data this member currently has.

Type:

str

property sidekick

The sidekick id of the sidekick this member currently has equipped.

Type:

str

property sidekick_variants

A list containing the raw variants data for the currently equipped sidekick.

Warning

Variants doesn’t seem to follow much logic. Therefore this returns the raw variants data received from fortnite’s service. This can be directly passed with the variants keyword to ClientPartyMember.set_sidekick().

Type:

list

property victory_crowns

The current crown wins of this member.

Type:

int

property will_yield_leadership

Whether or not this member will promote another member as soon as there is a chance for it. This is usually only True for Just Chattin’ members.

Type:

bool

property zombie_since

The utc datetime this member went into a zombie state. None if this user is currently not a zombie.

Type:

Optional[datetime.datetime]

Party

class rebootpy.Party[source]

Represent a party that the ClientUser is not yet a part of.

async join()[source]

This function is a coroutine.

Joins the party.

Raises:
  • .. warning:: – Because the client has to leave its current party before joining a new one, a new party is created if some of these errors are raised. Most of the time though this is not the case and the client will remain in its current party.

  • PartyError – You are already a member of this party.

  • NotFound – The party was not found.

  • Forbidden – You are not allowed to join this party because it’s private and you have not been a part of it before. .. note:: If you have been a part of the party before but got kicked, you are ineligible to join this party and this error is raised.

  • HTTPException – An error occurred when requesting to join the party.

Returns:

The party that was just joined.

Return type:

ClientParty

property applicants

The party’s applicants.

Type:

list

property client

The client.

Type:

Client

get_member(user_id)

Optional[PartyMember]: Attempts to get a party member from the member cache. Returns None if no user was found by the user id.

property id

The party’s id.

Type:

str

property leader

The leader of the party.

Type:

PartyMember

property member_count

The amount of member currently in this party.

Type:

int

property members

A copied list of the members currently in this party.

Type:

List[PartyMember]

property playlist_info

A tuple containing the name and session id (if in-game) of the currently set playlist.

Example output:

# output for default duos
(
    'Playlist_DefaultDuo',
    '',
)

# output for esl capture the flag (when player is in-game)
(
    '0363-4024-8917',
    '820665c477184929aa5d0e1f56902cfd'
)
Type:

tuple

property privacy

The currently set privacy of this party.

Type:

PartyPrivacy

property region

The currently set region of this party.

Type:

Region

property squad_assignments

The squad assignments for this party. This includes information about a members position and visibility.

Type:

Dict[PartyMember, SquadAssignment]

property squad_fill

True if squad fill is enabled else False.

Type:

bool

ClientParty

class rebootpy.ClientParty[source]

Represents ClientUser’s party.

property me

The clients partymember object.

Type:

ClientPartyMember

async send(content)[source]

This function is a coroutine.

Sends a message to this party’s chat.

Parameters:

content (str) – The content of the message, up to 256 characters.

Raises:

ChatError – Content is longer than 256 characters or the client is in a party on its own.

async edit(*coros)[source]

This function is a coroutine.

Edits multiple meta parts at once.

Example:

from functools import partial

async def edit_party():
    party = client.party
    await party.edit(
        party.set_privacy(rebootpy.PartyPrivacy.PRIVATE), # usage with non-awaited coroutines
        partial(party.set_custom_key, 'myawesomekey') # usage with functools.partial()
    )
Parameters:

*coros (Union[asyncio.coroutine, functools.partial]) – A list of coroutines that should be included in the edit.

Raises:

HTTPException – Something went wrong while editing.

async edit_and_keep(*coros)[source]

This function is a coroutine.

Edits multiple meta parts at once and keeps the changes for when new parties are created.

This example sets the custom key to myawesomekey and the playlist to Creative.:

from functools import partial

async def edit_and_keep_party():
    party = client.party
    await party.edit_and_keep(
        partial(party.set_custom_key, 'myawesomekey'),
        partial(party.set_playlist, 'Playlist_PlaygroundV2')
    )
Parameters:

*coros (functools.partial) – A list of coroutines that should be included in the edit. Unlike ClientParty.edit(), this method only takes coroutines in the form of a functools.partial.

Raises:

HTTPException – Something went wrong while editing.

async set_squad_assignments(assignments)[source]

This function is a coroutine.

Sets squad assignments for members of the party.

Parameters:

assignments (Dict[PartyMember, SquadAssignment]) –

Pre-defined assignments to set. If a member is missing from this dict, they will be automatically added to the final request.

Example:

{
    member1: rebootpy.SquadAssignment(position=5),
    member2: rebootpy.SquadAssignment(hidden=True)
}

Raises:
  • ValueError – Duplicate positions were set in the assignments.

  • Forbidden – You are not the leader of the party.

  • HTTPException – An error occurred while requesting.

async invite(user_id)[source]

This function is a coroutine.

Invites a user to the party.

Parameters:

user_id (str) – The id of the user to invite.

Raises:
  • PartyError – User is already in your party.

  • PartyError – The party is full.

  • Forbidden – The invited user is not friends with the client.

  • HTTPException – Something else went wrong when trying to invite the user.

Returns:

Object representing the sent party invitation.

Return type:

SentPartyInvitation

async fetch_invites()[source]

This function is a coroutine.

Fetches all active invitations sent from the party.

Warning

Because of an error on fortnite’s end, this method only returns invites sent from other party members if the party is private. However it will always return invites sent from the client regardless of party privacy.

Raises:

HTTPException – An error occurred while requesting from fortnite’s services.

Returns:

A list of all sent invites from the party.

Return type:

List[SentPartyInvitation]

async set_privacy(privacy)[source]

This function is a coroutine.

Sets the privacy of the party.

Parameters:

privacy (PartyPrivacy)

Raises:

Forbidden – The client is not the leader of the party.

async set_region(region)[source]

This function is a coroutine.

Sets the current region of the party.

Sets the region to Europe:

await party.set_region(
    region=rebootpy.Region.EUROPE,
)
Parameters:

region (Region) – The region to use.

Raises:

Forbidden – The client is not the leader of the party.

async set_custom_key(key)[source]

This function is a coroutine.

Sets the custom key of the party.

Parameters:

key (str) – The key to set.

Raises:

Forbidden – The client is not the leader of the party.

async set_fill(value)[source]

This function is a coroutine.

Sets the fill status of the party.

Parameters:

value (bool) –

What to set the fill status to.

True sets it to ‘Fill’ False sets it to ‘NoFill’

Raises:

Forbidden – The client is not the leader of the party.

async set_max_size(size)[source]

This function is a coroutine.

Sets a new max size of the party.

Parameters:

size (int) – The size to set. Must be more than the current member count, more than or equal to 1 or less than or equal to 16.

Raises:
  • Forbidden – The client is not the leader of the party.

  • PartyError – The new size was lower than the current member count.

  • PartyError – The new size was not <= 1 and <= 16.

async set_playlist(playlist='', version=-1)[source]

This function is a coroutine.

Sets the current playlist of the party.

Sets the playlist to Duos:

await party.set_playlist(
    playlist='Playlist_DefaultDuo',
)

Sets the playlist to ESL Capture The Flag:

await party.set_playlist(
    playlist='0363-4024-8917'
)
Parameters:
  • playlist (str) – The playlist id or island code.

  • version (int) – The version of the playlist/island, defaults to -1 which is latest.

property applicants

The party’s applicants.

Type:

list

property client

The client.

Type:

Client

get_member(user_id)

Optional[PartyMember]: Attempts to get a party member from the member cache. Returns None if no user was found by the user id.

property id

The party’s id.

Type:

str

property leader

The leader of the party.

Type:

PartyMember

property member_count

The amount of member currently in this party.

Type:

int

property members

A copied list of the members currently in this party.

Type:

List[PartyMember]

property playlist_info

A tuple containing the name and session id (if in-game) of the currently set playlist.

Example output:

# output for default duos
(
    'Playlist_DefaultDuo',
    '',
)

# output for esl capture the flag (when player is in-game)
(
    '0363-4024-8917',
    '820665c477184929aa5d0e1f56902cfd'
)
Type:

tuple

property privacy

The currently set privacy of this party.

Type:

PartyPrivacy

property region

The currently set region of this party.

Type:

Region

property squad_assignments

The squad assignments for this party. This includes information about a members position and visibility.

Type:

Dict[PartyMember, SquadAssignment]

property squad_fill

True if squad fill is enabled else False.

Type:

bool

ReceivedPartyInvitation

Methods
class rebootpy.ReceivedPartyInvitation[source]

Represents a received party invitation.

client

The client.

Type:

Client

party

The party the invitation belongs to.

Type:

Party

net_cl

The net_cl received by the sending client.

Type:

str

sender

The friend that invited you to the party.

Type:

Friend

created_at

The UTC time this invite was created at.

Type:

datetime.datetime

async accept()[source]

This function is a coroutine.

Accepts the invitation and joins the party.

Warning

A bug within the fortnite services makes it not possible to join a private party you have been kicked from.

Raises:
  • Forbidden – You attempted to join a private party you’ve been kicked from.

  • HTTPException – Something went wrong when accepting the invitation.

Returns:

The party the client joined by accepting the invitation.

Return type:

ClientParty

async decline()[source]

This function is a coroutine.

Declines the invitation.

Raises:
  • PartyError – The clients net_cl is not compatible with the received net_cl.

  • HTTPException – Something went wrong when declining the invitation.

SentPartyInvitation

Methods
class rebootpy.SentPartyInvitation[source]

Represents a sent party invitation.

client

The client.

Type:

Client

party

The party the invitation belongs to.

Type:

Party

sender

The party member that sent the invite.

Type:

PartyMember

receiver

The user that the invite was sent to.

Type:

User

created_at

The UTC time this invite was created at.

Type:

datetime.datetime

async cancel()[source]

This function is a coroutine.

Cancels the invite. The user will see an error message saying something like <users>'s party is private.

Raises:
  • Forbidden – Attempted to cancel an invite not sent by the client.

  • HTTPException – Something went wrong while requesting to cancel the invite.

async resend()[source]

This function is a coroutine.

Resends an invite with a new notification popping up for the receiving user.

Raises:
  • Forbidden – Attempted to resend an invite not sent by the client.

  • HTTPException – Something went wrong while requesting to resend the invite.

PartyJoinConfirmation

Methods
class rebootpy.PartyJoinConfirmation[source]

Represents a join confirmation.

client

The client.

Type:

Client

party

The party the user wants to join.

Type:

ClientParty

user

The user who requested to join the party.

Type:

User

created_at

The UTC time of when the join confirmation was received.

Type:

datetime.datetime

async confirm()[source]

This function is a coroutine.

Confirms this user.

Note

This call does not guarantee that the player will end up in the clients party. Please always listen to event_party_member_join() to ensure that the player in fact joined.

Raises:

HTTPException – Something went wrong when confirming this user.

async reject()[source]

This function is a coroutine.

Rejects this user.

Raises:

HTTPException – Something went wrong when rejecting this user.

PartyJoinRequest

Methods
class rebootpy.PartyJoinRequest(client, party, friend, data)[source]

Represents a party join request. These requests are in most cases only received when the bots party privacy is set to private.

client

The client.

Type:

Client

party

The party the user wants to join.

Type:

ClientParty

friend

The friend who requested to join the party.

Type:

Friend

created_at

The UTC timestamp of when this join request was created.

Type:

datetime.datetime

expires_at

The UTC timestamp of when this join request will expire. This should always be one minute after its creation.

Type:

datetime.datetime

async accept()[source]

This function is a coroutine.

Accepts a party join request. Accepting this before the request has expired forces the sender to join the party. If not then the sender will receive a regular party invite.

Raises:

Presence

class rebootpy.Presence[source]

Represents a presence received from a friend

client

The client.

Type:

Client

available

Whether or not the user is online. True if the friend is or went online, False if the friend went offline.

Type:

bool

away

The users away status.

Type:

AwayStatus

friend

The friend you received this presence from.

Type:

Friend

platform

The platform this presence was sent from.

Type:

Platform

received_at

The UTC time of when the client received this presence.

Type:

datetime.datetime

status

The friend’s status.

Type:

str

playing

Says if friend is playing.

Type:

bool

joinable

Says if friend is joinable.

Type:

bool

session_id

The friend’s current session id. Often referred to as server key or game key. Returns None if the friend is not currently in a game.

Type:

str

has_properties

True if the presence has properties else False.

Warning

All attributes below this point will be None if has_properties is False.

Type:

bool

party

The friend’s party.

Type:

PresenceParty

gameplay_stats

The friend’s gameplay stats. Will be None if no gameplay stats are currently available.

Type:

Optional[PresenceGameplayStats]

homebase_rating

The friend’s homebase rating

Type:

str

lfg

True if the friend is currently looking for a game.

Type:

bool

sub_game

The friend’s current subgame.

Type:

int

in_unjoinable_match

True if friend is in unjoinable match else False.

Type:

bool

playlist

The friend’s current playlist.

Type:

str

party_size

The size of the friend’s party.

Type:

int

max_party_size

The max size of the friend’s party.

Type:

int

game_session_join_key

The join key of the friend’s session.

Type:

str

server_player_count

The playercount of the friend’s server.

Type:

str

PresenceParty

class rebootpy.PresenceParty[source]

Represents a party received from presence.

Before accessing any of this class’ attributes or functions you should always check if the party is private:

@client.event
async def event_friend_presence(before, after):
    # after is the newly received presence
    presence = after

    # check if presence is from the account 'Terbau'
    # NOTE: you should always use id over display_name
    # but for this example i've use display_name just
    # to demonstrate.
    if presence.friend.display_name != 'Terbau':
        return

    # check if party is private
    if presence.party.private:
        return

    # if all the checks above succeeds we join the party
    await presence.party.join()

Note

If the party is private, all attributes below private will be None.

client

The client.

Type:

str

private

True if the party is private else False.

Type:

bool

platform

The platform of the friend.

Type:

Platform

id

The party’s id.

Type:

str

party_type_id

The party’s type id.

Type:

str

key

The party’s key.

Type:

str

app_id

The party’s app id.

Type:

str

build_id

The party’s build id. Similar format to Client.party_build_id.

Type:

str

net_cl

The party’s net_cl. Similar format to Client.net_cl.

Type:

str

party_flags

The party’s flags.

Type:

str

not_accepting_reason

The party’s not accepting reason.

Type:

str

playercount

The party’s playercount.

Type:

int

async join()[source]

This function is a coroutine.

Joins the friends’ party.

Raises:
  • PartyError – You are already a member of this party.

  • Forbidden – The party is private.

  • HTTPException – Something else went wrong when trying to join this party.

Returns:

The party that was just joined.

Return type:

ClientParty

PresenceGameplayStats

class rebootpy.PresenceGameplayStats[source]

Represents gameplaystats received from presence.

friend

The friend these stats belong to.

Type:

Friend

state

The state.

Note

It’s not really known what value this property might hold. This is pretty much always an empty string.

Type:

str

playlist

The playlist.

Note

The playlist from the gameplay stats property usually isn’t updated. Consider using Presence.playlist instead as that seems to always be the correct playlist.

Type:

str

players_alive

The amount of players alive in the current game.

Type:

int

kills

The amount of kills the friend currently has. Aliased to num_kills as well for legacy reasons.

Type:

int

fell_to_death

True if friend fell to death in its current game, else False

Type:

bool

StatsV2

class rebootpy.StatsV2[source]

Represents a users Battle Royale stats on Fortnite.

get_kd(data)[source]

Gets the kd of a gamemode

Usage:

# gets sypherpks kd in solo on input touch
async def get_sypherpk_touch_solo_kd():
    user = await client.fetch_user('SypherPK')
    stats = await client.fetch_br_stats(user.id)

    return stats.get_kd(stats.get_stats()['touch']['defaultsolo'])
Parameters:

data (dict) – A dict which at least includes the keys: kills, matchesplayed and wins.

Returns:

Returns the kd with a decimal point accuracy of two.

Return type:

float

get_winpercentage(data)[source]

Gets the winpercentage of a gamemode

Usage:

# get my winpercentage in zero build squads on kbm touch
async def get_6v_zb_squad_winpercentage():
    user = await client.fetch_user('6v.')
    stats = await client.fetch_br_stats(user.id)

    return stats.get_winpercentage(stats.get_stats()['keyboardmouse']['nobuildbr_squad'])
Parameters:

data (dict) – A dict which atleast includes the keys: matchesplayed`` and wins.

Returns:

Returns the winpercentage with a decimal point accuracy of two.

Return type:

float

get_stats()[source]

Gets the stats for this user. This function returns the users stats.

Returns:

Mapping of the users stats. All stats are mapped to their respective gamemodes.

Return type:

dict

get_combined_stats(platforms=True)[source]

Gets combined stats for this user.

Parameters:

platforms (bool) –

True if the combined stats should be mapped to their

respective region. | False to return all stats combined across platforms.

Returns:

Mapping of the users stats combined. All stats are added together and no longer sorted into their respective gamemodes.

Return type:

dict

StatsCollection

Attributes
Methods
class rebootpy.StatsCollection[source]

Represents a users Battle Royale stats collection on Fortnite.

property name

The collection name.

Type:

str

get_stats()[source]

Gets the stats collection for this user. This function returns the users collection.

Returns:

Mapping of the users collection.

Return type:

dict

BattleRoyaleNewsPost

class rebootpy.BattleRoyaleNewsPost[source]
property image

The image url of this post.

Type:

str

property hidden

True if post is hidden else False.

Type:

bool

property type

The type of this message.

Type:

str

property title

The title of this post.

Type:

str

property body

The actual message of this post.

Type:

str

property spotlight

True if this post is in the spotlight else False.

Type:

bool

property adspace

The adspace of this post. None if no adspace is found.

Type:

str

Store

class rebootpy.Store[source]

Object representing store data from Fortnite Battle Royale.

client

The client.

Type:

Client

property items

A list containing data about all items in the item shop.

Type:

List[StoreItem]

property daily_purchase_hours

How many hours a day it is possible to purchase items. It most likely is 24.

Type:

int

property refresh_interval_hours

Refresh interval hours.

Type:

int

property created_at

The UTC time of the creation and current day.

Type:

datetime.datetime

property expires_at

The UTC time of when this item shop expires.

Type:

datetime.datetime

StoreItem

class rebootpy.StoreItem[source]

Featured store item.

property display_names

The display names for this item.

Type:

List[str]

property dev_name

The dev name of this item.

Type:

str

property asset_path

The asset path of the item. Could be None if not found.

Type:

str

property asset

The asset of the item. Usually a CID or or something similar. Could be None if not found.

Type:

str

property encryption_key

The encryption key for this item. If no encryption key is found, this will be None.

Type:

str

property gifts_enabled

True if gifts is enabled for this item else False.

Type:

bool

property daily_limit

The daily account limit for this item. -1 = Unlimited.

Type:

int

property weekly_limit

The weekly account limit for this item. -1 = Unlimited.

Type:

int

property monthly_limit

The monthly account limit for this item. -1 = Unlimited.

Type:

int

property offer_id

The offer id of this item.

Type:

str

property offer_type

The offer type of this item.

Type:

str

property price

The price of this item in v-bucks.

Type:

int

property refundable

True if item is refundable else False.

Type:

bool

property grants

A list of items you get from this purchase.

Typical output:

[{
    'quantity': 1,
    'type': 'AthenaCharacter',
    'asset': 'cid_318_athena_commando_m_demon'
}]
Type:

list

property new

True if the item is in the item shop for the first time, else False.

Type:

bool

property violator

The violator of this item. Violator is the red tag at the top of an item in the shop. Will be None if no violator is found for this item.

Type:

str

property panel

The panel the item is listed in from left to right.

Type:

int

Playlist

class rebootpy.Playlist[source]
property image_url

Image url for the playlist.

Type:

str

property internal_name

The internal name of the playlist.

Type:

str

property type

The type of this playlist object.

Type:

str

property special_border

Special border of the playlist. Will be None if no special border is found for this playlist.

Type:

Optional[str]

property violator

The violater displayed for this playlist. This is the little red tag displaying short text on some of the playlists in-game. Will be None if no violator is found for this playlist.

Type:

Optional[str]

property display_subname

The display subname of this playlist. Will be None if no display subname is found for this playlist.

Type:

Optional[str]

property description

The description of this playlist. Will be None if no description is found for this playlist.

Type:

Optional[str]

CreativeIsland

class rebootpy.CreativeIsland[source]

Creative island.

property creator_name

The name of the island creator.

Type:

str

property creator_account_id

The account id of the island creator.

Type:

str

property mnemonic

The mnemonic of the island, either being island code or playlist id.

Type:

str

property name

The name of the island.

Type:

str

property image_url

The image URL of the island.

Type:

str

property version

The current iteration of the island.

Type:

int

property active

Whether or not the island is active.

Type:

bool

property created

The UTC time the island was created.

Type:

datetime.datetime

property published

The UTC time the island was published.

Type:

datetime.datetime

property description_tags

List of description tags.

Type:

list

property lobby_background_image

The image URL of the lobby background, if none Fortnite will use the default.

Type:

str

property creator_sac_slug

The Support-a-Creator slug of the island creator.

Type:

str

property tagline

The tagline of the island.

Type:

str

property ratings

A list containing data about all age ratings for the island.

Type:

List[CreativeIslandRating]

property is_creative_island

Returns True if the island is a creative map, False if it is a playlist.

Type:

bool

CreativeIslandRating

class rebootpy.CreativeIslandRating[source]

Creative island rating.

property board

The name of the board of which the rating is from.

Type:

str

property descriptors

Rating descriptors of the island.

Type:

str

property rating

The rating of the island.

Type:

str

property initial_rating

The initial rating of the island.

Type:

str

property interactive_elements

Interactive elements of the island.

Type:

str

CompetitiveRank

class rebootpy.CompetitiveRank[source]

Represents a specific rank type.

property ranking_type

The type of rank.

Type:

RankingType

property last_updated

The last time the stats were updated.

Type:

datetime.datetime

property current_division

The curent/final rank of the player in that season.

Type:

Rank

property highest_division

The highest rank of the player in that season.

Type:

Rank

property promotion_progress

The players progress through their current/final rank.

Type:

float

property unreal_placement

Their placement in Unreal, will be None if they’re not Unreal.

Type:

int

Data Classes

Data classes used as data containers in the library.

DefaultPartyConfig

class rebootpy.DefaultPartyConfig[source]

Data class for the default party configuration used when a new party is created.

Parameters:
  • privacy (Optional[PartyPrivacy]) –

    The party privacy that should be used.
    Defaults to: PartyPrivacy.PUBLIC

  • max_size (Optional[int]) –

    The maximum party size. Valid party sizes must use a value

    between 1 and 16. | Defaults to 16

  • chat_enabled (Optional[bool]) –

    Whether or not the party chat should be enabled for the party.
    Defaults to True.

  • team_change_allowed (bool) –

    Whether or not players should be able to manually swap party team

    with another player. This setting only works if the client is the leader of the party. | Defaults to True

  • default_squad_assignment (SquadAssignment) –

    The default squad assignment to use for new members. Squad assignments

    holds information about a party member’s current position and visibility. Please note that setting a position in the default squad assignment doesnt actually do anything and it will just be overridden. | Defaults to SquadAssignment(hidden=False).

  • position_priorities (List[int]) –

    A list of exactly 16 ints all ranging from 0-15. When a new member

    joins the party or a member is not defined in a squad assignment request, it will automatically give the first available position in this list. | Defaults to a list of 0-15 in order.

  • reassign_positions_on_size_change (bool) –

    Whether or not positions should be automatically reassigned if the party

    size changes. Set this to False if you want members to keep their positions unless manually changed. The reassignment is done according to the position priorities. | Defaults to True.

  • joinability (Optional[PartyJoinability]) –

    The joinability configuration that should be used.
    Defaults to PartyJoinability.OPEN

  • discoverability (Optional[PartyDiscoverability]) –

    The discoverability configuration that should be used.
    Defaults to PartyDiscoverability.ALL

  • invite_ttl (Optional[int]) –

    How many seconds the invite should be valid for before

    automatically becoming invalid. | Defaults to 14400

  • intention_ttl (Optional[int]) –

    How many seconds an intention should last.
    Defaults to 60

  • sub_type (Optional[str]) –

    The sub type the party should use.
    Defaults to 'default'

  • party_type (Optional[str]) –

    The type of the party.
    Defaults to 'DEFAULT'

  • cls (Type[ClientParty]) –

    The default party object to use for the client’s party. Here you can

    specify all class objects that inherits from ClientParty.

  • meta (List[functools.partial]) –

    A list of coroutines in the form of partials. This config will be automatically equipped by the party when a new party is created by the client.

    from rebootpy import ClientParty
    from functools import partial
    
    [
        partial(ClientParty.set_custom_key, 'myawesomekey'),
        partial(ClientParty.set_playlist, 'Playlist_PlaygroundV2')
    ]
    

team_change_allowed

Whether or not players are able to manually swap party team with another player. This setting only works if the client is the leader of the party.

Type:

bool

default_squad_assignment

The default squad assignment to use for new members and members not specified in manual squad assignments requests.

Type:

SquadAssignment

position_priorities

A list containing exactly 16 integers ranging from 0-16 with no duplicates. This is used for position assignments.

Type:

List[int]

reassign_positions_on_size_change

Whether or not positions will be automatically reassigned when the party size changes.

Type:

bool

cls

The default party object used to represent the client’s party.

Type:

Type[ClientParty]

DefaultPartyMemberConfig

class rebootpy.DefaultPartyMemberConfig[source]

Data class for the default party member configuration used when the client joins a party.

Parameters:
  • cls (Type[ClientPartyMember]) – The default party member object to use to represent the client as a party member. Here you can specify all classes that inherits from ClientPartyMember. The library has one out of the box objects that you can use: - ClientPartyMember (Default)

  • yield_leadership (bool:) – Whether or not the client should promote another member automatically whenever there is a chance to. Defaults to False

  • offline_ttl (int) – How long the client should stay in the party disconnected state before expiring when the xmpp connection is lost. Defaults to 30.

  • meta (List[functools.partial]) –

    A list of coroutines in the form of partials. This config will be automatically equipped by the bot when joining new parties.

    from rebootpy import ClientPartyMember
    from functools import partial
    
    [
        partial(ClientPartyMember.set_outfit, 'CID_175_Athena_Commando_M_Celestial'),
        partial(ClientPartyMember.set_banner, icon="OtherBanner28", season_level=100)
    ]
    

cls

The default party member object used when representing the client as a party member.

Type:

Type[ClientPartyMember]

yield_leadership

Whether or not the client promotes another member automatically whenever there is a chance to.

Type:

bool

offline_ttl

How long the client will stay in the party disconnected state before expiring when the xmpp connection is lost.

Type:

int

HTTPRetryConfig

class rebootpy.HTTPRetryConfig[source]

Config for how HTTPClient should handle retries.

Warning

Messing with these values could potentially make retries spammy. Worst case scenario of this would be that either your ip or your account could be limited due to high traffic. Change these values with caution!

Parameters:
  • max_retry_attempts (int) –

    The max amount of retry attempts for a request. Defaults to 5.

    Note

    This is ignored when handling capacity throttling.

  • max_wait_time (Optional[float]) – The max amount of seconds to wait for a request before raising the original exception. This works by keeping track of the total seconds that has been waited for the request regardless of number of attempts. If None this is ignored. Defaults to 65.

  • handle_rate_limits (bool) –

    Whether or not the client should handle rate limit errors and wait the received Retry-After before automatically retrying the request. Defaults to True.

    Note

    This option is only for throttling errors with a Retry-After value.

  • max_retry_after (float) – The max amount of seconds the client should handle. If a throttled error with a higher Retry-After than this value is received, then the original HTTPException is raised instead. Only matters when ``handle_rate_limits`` is ``True``

  • other_requests_wait (bool) – Whether other requests to a rate limited endpoint should wait for the rate limit to disappear before requesting. Defaults to True. Only matters when ``handle_rate_limits`` is ``True``

  • handle_capacity_throttling (bool) – Whether or not the client should automatically handle capacity throttling errors. These occur when the prod server you are requesting from has no available capacity to process a request and therefore returns with a throttle error without a Retry-After. Defaults to True.

  • backoff_start (float) – The initial seconds to wait for the exponential backoff. Defaults to 1. Only matters when ``handle_capacity_throttling`` is ``True``

  • backoff_factor (float) – The multiplying factor used for the exponential backoff when a request fails. Defaults to 1.5. Only matters when ``handle_capacity_throttling`` is ``True``

  • backoff_cap (float) – The cap for the exponential backoff to avoid having unrealistically high wait times. Defaults to 20. Only matters when ``handle_capacity_throttling`` is ``True``

Route

class rebootpy.Route[source]

Represents a route to use for a http request. This should be subclassed by new routes and the class attributes BASE and optionally AUTH should be overridden.

Warning

Usually there is no reason to subclass and implement routes yourself as most of them are already implemented. Take a look at http.py if you’re interested in knowing all of the predefined routes.

Available authentication placeholders: - IOS_BASIC_TOKEN - FORTNITE_BASIC_TOKEN - IOS_ACCESS_TOKEN - FORTNITE_ACCESS_TOKEN

Example usage:

class SocialBanPublicService(rebootpy.Route):
    BASE = 'https://social-ban-public-service-prod.ol.epicgames.com'
    AUTH = 'FORTNITE_ACCESS_TOKEN'

route = SocialBanPublicService(
    '/socialban/api/public/v1/{user_id}',
    user_id='c7af4984a77a498b83d8b16d475d76bc'
)
resp = await client.http.get(route)

# resp would look something like this:
# {
#     "bans" : [],
#     "warnings" : []
# }
Parameters:
  • path (path) –

    The path to used for the request.

    Warning

    You should always use name formatting for arguments and instead of using `.format()`on the path, you should pass the format kwargs as kwargs to the route. This might seem counterintuitive but it is important to ensure rate limit retry reliability.

  • auth (Optional[str]) – The authentication to use for the request. If None the default auth specified for the route is used.

  • **params (Any) – The variables to format the path with passed alongside their name.

path

The requests path.

Type:

str

params

A mapping of the params passed.

Type:

Dict[str, Any]

base

The base of the request url.

Type:

str

auth

The auth placeholder.

Type:

Optional[str]

url

The formatted url.

Type:

str

sanitized_url

The yet to be formatted url.

Type:

str

Avatar

class rebootpy.Avatar[source]

Represents a friend’s avatar. This is always related to the outfit the friend has equipped.

property namespace

The namespace of the avatar.

Type:

str

property asset_type

The asset type. This is usually ATHENACHARACTER If the friend has no avatar set, or has a default character set, then this will be None.

Type:

Optional[str]

property asset

The asset of the avatar. This is usually a CID in full caps. If the friend has no avatar set, or has a default character set, then this will be None.

Type:

Optional[str]

SquadAssignment

class rebootpy.SquadAssignment[source]

Represents a party members squad assignment. A squad assignment is basically a piece of information about which position a member has in the party, which is directly related to party teams.

Parameters:
  • position (Optional[int]) – The position a member should have in the party. If no position is passed, a position will be automatically given according to the position priorities set.

  • hidden (bool) –

    Whether or not the member should be hidden in the party.

    Warning

    Being hidden is not a native fortnite feature so be careful when using this. It might lead to undesirable results.

Exceptions

exception rebootpy.FortniteException[source]

Base exception for rebootpy.

This could in theory be caught to handle all exceptions thrown by this library.

exception rebootpy.AuthException(message, original)[source]

This exception is raised when auth fails by invalid credentials passed or some other misc failure.

original

The original exception raised. The original error always inherits from FortniteException.

Type:

FortniteException

exception rebootpy.HTTPException(response, route, message, request_headers)[source]

This exception is raised when an error is received by Fortnite services.

response

The response from the HTTP request.

Type:

aiohttp.ClientResponse

text

The error message.

Type:

str

status

The status code of the HTTP request.

Type:

int

route

The route or url used for this request.

Type:

Union[Route, str]

raw

The raw message/data received from Fortnite services.

Type:

Union[str, dict]

request_headers

The headers used for the request.

Type:

dict

message

The raw error message received from Fortnite services.

Type:

str

message_code

The raw error message code received from Fortnite services.

Type:

Optional[str]

message_vars

List containing arguments passed to the message.

Type:

List[str]

code

The error code received from Fortnite services.

Type:

Optional[int]

originating_service

The originating service this error was received from.

Type:

Optional[str]

intent

The prod this error was received from.

Type:

Optional[str]

validation_failures

A list containing information about the validation failures. None if the error was not raised a validation issue.

Type:

Optional[List[ValidationFailure]]

exception rebootpy.ValidationFailure(data)[source]

Represents a validation failure returned.

field_name

Name of the field that was invalid.

Type:

str

invalid_value

The invalid value.

Type:

str

message

The message explaining why the field value was invalid.

Type:

str

message_code

The raw error message code received.

Type:

str

message_vars

The message variables received.

Type:

Dict[str, str]

exception rebootpy.EventError[source]

This exception is raised when something regarding events fails.

exception rebootpy.XMPPError[source]

This exception is raised when something regarding the XMPP service fails.

exception rebootpy.PartyError[source]

This exception is raised when something regarding parties fails.

exception rebootpy.PartyIsFull[source]

This exception is raised when the bot attempts to join a full party.

exception rebootpy.Forbidden[source]

This exception is raised whenever you attempted a request that your account does not have permission to do.

exception rebootpy.NotFound[source]

This exception is raised when something was not found by fortnites services.

exception rebootpy.DuplicateFriendship[source]

This exception is raised whenever the client attempts to add a user as friend when the friendship already exists.

exception rebootpy.FriendshipRequestAlreadySent[source]

This exception is raised whenever the client attempts to send a friend request to a user that has already received a friend request from the client.

exception rebootpy.MaxFriendshipsExceeded[source]

This excepttion is raised if the client has hit the limit for friendships.

exception rebootpy.InviteeMaxFriendshipsExceeded[source]

This exception is raised if the user you attempted to add has hit the limit for friendships.

exception rebootpy.InviteeMaxFriendshipRequestsExceeded[source]

This exception is raised if the user you attempted to add has hit the limit for the amount of friendship requests a user can have at a time.

exception rebootpy.FriendOffline[source]

This exception is raised when an action that requires a friend to be online is performed at an offline friend.

exception rebootpy.InvalidOffer[source]

This exception is raised when an invalid/outdated offer is passed. Only offers currently in the item shop are valid.

exception rebootpy.ChatError[source]

This exception is raised whenever there is an issue with the chat service i.e. message too long, client attempts to send a message into an empty party, etc.