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
DeviceAuthifdevice_id,account_idandsecretare present.2.
DeviceCodeAuthis tried ifprompt_device_codeisTrue.3.
ExchangeCodeAuthis tried ifexchange_codeis present or ifprompt_exchange_codeisTrue.4.
AuthorizationCodeAuthis tried ifauthorization_codeis present or ifprompt_authorization_codeisTrue.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
Trueand no exchange code is passed, you will be prompted to enter the exchange code in the console if needed.Note
Both
prompt_exchange_codeandprompt_authorization_codecannot be True at the same time.prompt_exchange_code (
bool) –If this is set to
Trueand no exchange code is passed, you will be prompted to enter the exchange code in the console if needed.Note
Both
prompt_exchange_codeandprompt_authorization_codecannot be True at the same time.prompt_authorization_code (
bool) –If this is set to
Trueand no authorization code is passed, you will be prompted to enter the authorization code in the console if needed.Note
Both
prompt_exchange_codeandprompt_authorization_codecannot 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
AuthExceptionis raised instead.Note
This only works if
prompt_exchange_codeorprompt_authorization_codeisTrue.prompt_code_if_throttled (
bool) –If this is set to
Trueand you receive a throttling response, you will be prompted to enter a code in the console.Note
This only works if
prompt_exchange_codeorprompt_authorization_codeisTrue.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.
- 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.
- 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:
- 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:
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.
- 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.
Clients¶
BasicClient¶
- @event()
- add_event_handler()
- get_user()
- is_closed()
- is_ready()
- register_connectors()
- remove_event_handler()
- run()
- awaitaccept_friend()
- awaitadd_friend()
- awaitblock_user()
- awaitclose()
- awaitfetch_active_ltms()
- awaitfetch_avatars()
- awaitfetch_battlepass_level()
- awaitfetch_blocklist()
- awaitfetch_br_news()
- awaitfetch_br_playlists()
- awaitfetch_br_stats()
- awaitfetch_creative_island()
- awaitfetch_event_tokens()
- awaitfetch_flag()
- awaitfetch_item_shop()
- awaitfetch_leaderboard()
- awaitfetch_lightswitch_status()
- awaitfetch_multiple_battlepass_levels()
- awaitfetch_multiple_br_stats()
- awaitfetch_multiple_br_stats_collections()
- awaitfetch_multiple_event_tokens()
- awaitfetch_multiple_flags()
- awaitfetch_party()
- awaitfetch_ranked_stats()
- awaitfetch_user()
- awaitfetch_user_by_display_name()
- awaitfetch_users()
- awaitfetch_users_by_display_name()
- awaitremove_or_decline_friend()
- awaitrestart()
- awaitsearch_sac_by_slug()
- awaitsearch_users()
- awaitstart()
- awaitunblock_user()
- awaitwait_for()
- awaitwait_until_closed()
- awaitwait_until_ready()
- 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:
Parties (except
BasicClient.fetch_party())Friends
Anything related to XMPP (Messaging and most events)
- 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 toWindows/10.0.17134.1.768.64bitwhich is valid no matter which platform you have set.cache_users (
bool) – Whether or not the library should cacheUserobjects. 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 toTrue.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 toTrue.
- user¶
The user the client is logged in as.
- Type:
- 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 inevent_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 usestart()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 clientsaiohttp.ClientSessionwhen logged out.dispatch_close (
bool) – Whether or not to dispatch the close event.
- Raises:
HTTPException – An error occurred while logging out.
- 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:
Trueif the internal state is ready elseFalse- Return type:
- 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:
- 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 namecache (
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:Tfuewill return Tfue’s user + up to 99 otherusers which have display names that start with or match exactly to
TfuelikeTfue_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:
- 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]
- 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
1000but 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
700total 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
FriendMessageto 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 theevent_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.
- event(event_or_coro=None)[source]¶
A decorator to register an event.
Note
You do not need to decorate events in a subclass of
BasicClientbut the function names of event handlers must follow this formatevent_<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!')
- 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:
- 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:
- 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
Noneis returned.- Return type:
- 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:
- 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:
- 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
StatsV2is bound to its owners id. If a userid was not found then the value bound to that userid will beNone.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:
- 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
StatsCollectionis bound to its owner’s id. If a userid was not found then the value bound to that userid will beNone.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 adatetime.datetimeinstance. 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 adatetime.datetimeinstance. 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
Noneif 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:
- 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 Noneend_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:
Forbidden – User has a private career board.
HTTPException – An error occurred while requesting.
- Returns:
The user’s battlepass level.
Noneis 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(winsis 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 useStatsV2.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:
- 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:
Trueif service is up elseFalse- Return type:
- 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:
- 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:
- 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:
Client¶
- @event()
- add_event_handler()
- get_blocked_user()
- get_friend()
- get_incoming_pending_friend()
- get_outgoing_pending_friend()
- get_pending_friend()
- get_presence()
- get_user()
- has_friend()
- is_blocked()
- is_closed()
- is_pending()
- is_ready()
- register_connectors()
- remove_event_handler()
- run()
- awaitaccept_friend()
- awaitadd_friend()
- awaitblock_user()
- awaitclose()
- awaitfetch_active_ltms()
- awaitfetch_avatars()
- awaitfetch_battlepass_level()
- awaitfetch_blocklist()
- awaitfetch_br_news()
- awaitfetch_br_playlists()
- awaitfetch_br_stats()
- awaitfetch_creative_island()
- awaitfetch_event_tokens()
- awaitfetch_flag()
- awaitfetch_item_shop()
- awaitfetch_leaderboard()
- awaitfetch_lightswitch_status()
- awaitfetch_multiple_battlepass_levels()
- awaitfetch_multiple_br_stats()
- awaitfetch_multiple_br_stats_collections()
- awaitfetch_multiple_event_tokens()
- awaitfetch_multiple_flags()
- awaitfetch_party()
- awaitfetch_ranked_stats()
- awaitfetch_user()
- awaitfetch_user_by_display_name()
- awaitfetch_users()
- awaitfetch_users_by_display_name()
- awaitjoin_party()
- awaitremove_or_decline_friend()
- awaitrestart()
- awaitsearch_sac_by_slug()
- awaitsearch_users()
- awaitsend_presence()
- awaitset_platform()
- awaitset_presence()
- awaitstart()
- awaitunblock_user()
- awaitwait_for()
- awaitwait_until_closed()
- awaitwait_until_ready()
- 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 toAwayStatus.ONLINE.platform (
Platform) – The platform you want the client to display as its source. Defaults toPlatform.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 ofv0.9.0since 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 to3(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 toWindows/10.0.17134.1.768.64bitwhich 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 cacheUserobjects. 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 toTrue.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 toTrue.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
Noneon objects deriving fromUser. Keep in mind thatUser.idalways will be available. You can useUser.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 likeevent_party_member_join(). If this is disabled then member objects in the events won’t have the correct meta. Defaults toTrue.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. IfDefaultPartyMemberConfig.offline_ttlis 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:
- party¶
The party the client is currently connected to.
- Type:
- 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 inevent_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.ws_connector (
aiohttp.BaseConnector) – The connector to use for the websocket xmpp connection.
- 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
incomingoroutgoing.
- 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:
- 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:
- property blocked_users¶
A list of the users client has as blocked.
- Type:
List[
BlockedUser]
- property presences¶
A list of the last presences from currently online friends.
- Type:
List[
Presence]
- 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:
Optional[Union[
IncomingPendingFriend,OutgoingPendingFriend]] – The pending friend if found, elseNone
- 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]
- 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:
- 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:
- 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.
- 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
1000but 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
700total 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 clientsaiohttp.ClientSessionwhen 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
BasicClientbut the function names of event handlers must follow this formatevent_<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!')
- 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:
- 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 Noneend_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:
Forbidden – User has a private career board.
HTTPException – An error occurred while requesting.
- Returns:
The user’s battlepass level.
Noneis 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:
- 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:
- 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
Noneis returned.- Return type:
- 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:
- 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:
- 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(winsis 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 useStatsV2.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:
- 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:
Trueif service is up elseFalse- Return type:
- 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 adatetime.datetimeinstance. 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 adatetime.datetimeinstance. 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
Noneif 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:
- 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
StatsV2is bound to its owners id. If a userid was not found then the value bound to that userid will beNone.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:
- 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
StatsCollectionis bound to its owner’s id. If a userid was not found then the value bound to that userid will beNone.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:
- 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:
- 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:
- 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 namecache (
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:
- Raises:
HTTPException – An error occurred while requesting the user.
- Returns:
A list containing all payloads found for this user.
- Return type:
List[
User]
- is_ready()¶
Specifies if the internal state of the client is ready.
- Returns:
Trueif the internal state is ready elseFalse- Return type:
- remove_event_handler(event, coro)¶
Removes a coroutine as an event handler.
- 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 usestart()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:Tfuewill return Tfue’s user + up to 99 otherusers which have display names that start with or match exactly to
TfuelikeTfue_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:
status (
str) – The status you want to set.away (
AwayStatus) – The away status to use. Defaults toAwayStatus.ONLINE.
- 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
FriendMessageto 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 theevent_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_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 instror full status indict.away (
AwayStatus) – The away status to use. Defaults toAwayStatus.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 withstart_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 to0.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 parameterclient. 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,BasicClientand an exception. The callback is called whenever a client fails logging in. The callback is not called ifshutdown_on_errorisTrue.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 to0.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 parameterclient. 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,BasicClientand an exception. The callback is called whenever a client fails logging in. The callback is not called ifshutdown_on_errorisTrue.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
PLAYSTATIONfor legacy reasons.
- PLAYSTATION_5¶
- XBOX_ONE¶
Also accessible under
XBOXfor 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.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 (
strortuple): The StatsV2 value for this season’s battle pass level.Nonefor seasons before Chapter 2.ranked_tracks (
tuple): The ranked tracks for this season.Nonefor seasons before Chapter 4, Season 2.
You don’t need to use
.valueto 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 keysdevice_id,account_idandsecret.
- rebootpy.event_device_code_generated(link)¶
This event is called whenever a device code link is generated during
DeviceCodeAuthorAdvancedAuth.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
ClientUserreceives 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.
- 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 thenevent_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, whileevent_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, whileevent_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_allowedtoFalseinDefaultPartyConfig.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 beNone.
- rebootpy.event_party_member_ready_change(member, before, after)¶
This event is called when a members ready state has changed.
- Parameters:
member (
PartyMember) – The member that changed.before (
ReadyState) – The previous ready state.after (
ReadyState) – The current ready status.
- 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.Noneif no emote was currently playing.after (
str) – The current emote eid.Noneif 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.Noneif no emoji was currently playing.after (
str) – The current emoji id.Noneif 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:
member (
PartyMember) – The member that changed.before (
tuple) – The previous banner data. Same structure asPartyMember.banner.after (
tuple) – The current banner data. Same structure asPartyMember.banner.
- rebootpy.event_party_member_battlepass_info_change(member, before, after)¶
This event is called when a members battlepass info has been changed.
- Parameters:
member (
PartyMember) – The member that changed.before (
tuple) – The previous battlepass data. Same structure asPartyMember.battlepass_info.after (
tuple) – The current battlepass data. Same structure asPartyMember.battlepass_info.
- 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 beNoneif not set.after (Optional[
list]) – The current corruption value. Could beNoneif not set.
- rebootpy.event_party_member_outfit_variants_change(member, before, after)¶
This event is called when a members outfit variants been changed.
- Parameters:
member (
PartyMember) – The member that changed.before (
list) – The previous outfit variants. Same structure asPartyMember.outfit_variants.after (
list) – The current outfit variants. Same structure asPartyMember.outfit_variants.
- rebootpy.event_party_member_backpack_variants_change(member, before, after)¶
This event is called when a members backpack variants been changed.
- Parameters:
member (
PartyMember) – The member that changed.before (
list) – The previous backpack variants. Same structure asPartyMember.backpack_variants.after (
list) – The current backpack variants. Same structure asPartyMember.backpack_variants.
- rebootpy.event_party_member_pickaxe_variants_change(member, before, after)¶
This event is called when a members pickaxe variants been changed.
- Parameters:
member (
PartyMember) – The member that changed.before (
list) – The previous pickaxe variants. Same structure asPartyMember.pickaxe_variants.after (
list) – The current pickaxe variants. Same structure asPartyMember.pickaxe_variants.
- rebootpy.event_party_member_contrail_variants_change(member, before, after)¶
This event is called when a members contrail variants been changed.
- Parameters:
member (
PartyMember) – The member that changed.before (
list) – The previous contrail variants. Same structure asPartyMember.contrail_variants.after (
list) – The current contrail variants. Same structure asPartyMember.contrail_variants.
- 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¶
- age_group
- can_update_display_name
- client
- country
- disabled
- display_name
- email_verified
- epicgames_account
- external_auths
- failed_login_attempts
- first_name
- full_name
- headless
- id
- jid
- last_login
- last_name
- minor_expected
- minor_status
- minor_verified
- name
- number_of_display_name_changes
- preferred_language
- tfa_enabled
- awaitfetch()
- awaitfetch_battlepass_level()
- awaitfetch_br_stats()
- awaitfetch_br_stats_collection()
- awaitfetch_event_tokens()
- awaitfetch_flag()
- awaitfetch_ranked_stats()
- class rebootpy.ClientUser[source]¶
Represents the user the client is connected to.
- client¶
The client.
- Type:
- headless¶
Trueif the account has no display name due to no epicgames account being linked to the current account.- Type:
- last_login¶
UTC time of the last login of the user.
Noneif no failed login attempt has been registered.- Type:
- first_name¶
First name of the user. Alias for name.
Warning
Can be
Noneif account is headless.- Type:
- property jid¶
The JID of the client. Includes the resource part.
- Type:
- 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:
- 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
NoneifClient.fetch_user_data_in_eventsis set toFalse.- Type:
Optional[
str]
- property epicgames_account¶
Tells you if the user is an account registered to epicgames services.
Falseif 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
Falseeven though the account is a registered epic games account ifClient.fetch_user_data_in_eventsis set toFalse.- Type:
- 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_eventsset toFalse.- 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.
Noneis 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 leaderboardHTTPException – An error occurred while requesting.
- Returns:
An object representing the stats for this user.
- Return type:
- 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 leaderboardHTTPException – An error occurred while requesting.
- Returns:
An object representing the stats collection for this user.
- Return type:
- 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]
ExternalAuth¶
- class rebootpy.ExternalAuth[source]¶
Represents an external auth belonging to a user.
- client¶
The client.
- Type:
- 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¶
- awaitadd()
- awaitblock()
- awaitfetch()
- awaitfetch_battlepass_level()
- awaitfetch_br_stats()
- awaitfetch_br_stats_collection()
- awaitfetch_event_tokens()
- awaitfetch_flag()
- awaitfetch_ranked_stats()
- 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
1000but 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
700total 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:
- 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
NoneifClient.fetch_user_data_in_eventsis set toFalse.- Type:
Optional[
str]
- property epicgames_account¶
Tells you if the user is an account registered to epicgames services.
Falseif 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
Falseeven though the account is a registered epic games account ifClient.fetch_user_data_in_eventsis set toFalse.- Type:
- 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_eventsset toFalse.- 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.
Noneis 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 leaderboardHTTPException – An error occurred while requesting.
- Returns:
An object representing the stats for this user.
- Return type:
- 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 leaderboardHTTPException – An error occurred while requesting.
- Returns:
An object representing the stats collection for this user.
- Return type:
- 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 jid¶
The JID of the user.
- Type:
BlockedUser¶
- awaitfetch()
- awaitfetch_battlepass_level()
- awaitfetch_br_stats()
- awaitfetch_br_stats_collection()
- awaitfetch_event_tokens()
- awaitfetch_flag()
- awaitfetch_ranked_stats()
- awaitunblock()
- class rebootpy.BlockedUser[source]¶
Represents a blocked user from Fortnite
- 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:
- 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
NoneifClient.fetch_user_data_in_eventsis set toFalse.- Type:
Optional[
str]
- property epicgames_account¶
Tells you if the user is an account registered to epicgames services.
Falseif 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
Falseeven though the account is a registered epic games account ifClient.fetch_user_data_in_eventsis set toFalse.- Type:
- 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_eventsset toFalse.- 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.
Noneis 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 leaderboardHTTPException – An error occurred while requesting.
- Returns:
An object representing the stats for this user.
- Return type:
- 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 leaderboardHTTPException – An error occurred while requesting.
- Returns:
An object representing the stats collection for this user.
- Return type:
- 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 jid¶
The JID of the user.
- Type:
UserSearchEntry¶
- awaitadd()
- awaitblock()
- awaitfetch()
- awaitfetch_battlepass_level()
- awaitfetch_br_stats()
- awaitfetch_br_stats_collection()
- awaitfetch_event_tokens()
- awaitfetch_flag()
- awaitfetch_ranked_stats()
- 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 matchedand 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
1000but 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
700total 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:
- 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
NoneifClient.fetch_user_data_in_eventsis set toFalse.- Type:
Optional[
str]
- property epicgames_account¶
Tells you if the user is an account registered to epicgames services.
Falseif 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
Falseeven though the account is a registered epic games account ifClient.fetch_user_data_in_eventsis set toFalse.- Type:
- 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_eventsset toFalse.- 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.
Noneis 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 leaderboardHTTPException – An error occurred while requesting.
- Returns:
An object representing the stats for this user.
- Return type:
- 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 leaderboardHTTPException – An error occurred while requesting.
- Returns:
An object representing the stats collection for this user.
- Return type:
- 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 jid¶
The JID of the user.
- Type:
SacSearchEntryUser¶
- awaitadd()
- awaitblock()
- awaitfetch()
- awaitfetch_battlepass_level()
- awaitfetch_br_stats()
- awaitfetch_br_stats_collection()
- awaitfetch_event_tokens()
- awaitfetch_flag()
- awaitfetch_ranked_stats()
- class rebootpy.SacSearchEntryUser[source]¶
Represents a user entry in a support a creator code search.
- Parameters:
- 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
1000but 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
700total 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:
- 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
NoneifClient.fetch_user_data_in_eventsis set toFalse.- Type:
Optional[
str]
- property epicgames_account¶
Tells you if the user is an account registered to epicgames services.
Falseif 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
Falseeven though the account is a registered epic games account ifClient.fetch_user_data_in_eventsis set toFalse.- Type:
- 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_eventsset toFalse.- 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.
Noneis 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 leaderboardHTTPException – An error occurred while requesting.
- Returns:
An object representing the stats for this user.
- Return type:
- 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 leaderboardHTTPException – An error occurred while requesting.
- Returns:
An object representing the stats collection for this user.
- Return type:
- 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 jid¶
The JID of the user.
- Type:
Friend¶
- is_online()
- awaitblock()
- awaitfetch()
- awaitfetch_avatar()
- awaitfetch_battlepass_level()
- awaitfetch_br_stats()
- awaitfetch_br_stats_collection()
- awaitfetch_event_tokens()
- awaitfetch_flag()
- awaitfetch_last_logout()
- awaitfetch_mutual_friends()
- awaitfetch_ranked_stats()
- awaitinvite()
- awaitjoin_party()
- awaitowns_offer()
- awaitremove()
- awaitremove_nickname()
- awaitremove_note()
- awaitrequest_to_join()
- awaitsend()
- awaitset_nickname()
- awaitset_note()
- awaitwait_until_offline()
- awaitwait_until_online()
- class rebootpy.Friend[source]¶
Represents a friend on Fortnite
- property favorite¶
Trueif the friend is favorited byClientUserelseFalse.- Type:
- property last_presence¶
The last presence retrieved by the friend. Might be
Noneif no presence has been received by this friend yet.- Type:
- property last_logout¶
The UTC time of the last time this friend logged off.
Noneif 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 withFriend.fetch_last_logout().- Type:
- property platform¶
The platform the friend is currently online on.
Noneif the friend is offline.- Type:
- 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 useClient.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:
Trueif the friend is currently online elseFalse.- Return type:
- 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
Noneif 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:3Max 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:
strThe note you want to set.Min length:3Max 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
FriendMessageto this friend.
- 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:
- async invite()[source]¶
This function is a coroutine.
Invites this friend to your party.
- Raises:
PartyError – Friend is already in your party.
PartyError – The party is full.
HTTPException – Something went wrong when trying to invite this friend.
- Returns:
Object representing the sent party invitation.
- Return type:
- 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:
PartyError – You are already a part of this friends party.
FriendOffline – The friend you requested to join is offline.
HTTPException – An error occurred while requesting.
- 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:
- 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:
- 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:
- 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:
- 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
NoneifClient.fetch_user_data_in_eventsis set toFalse.- Type:
Optional[
str]
- property epicgames_account¶
Tells you if the user is an account registered to epicgames services.
Falseif 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
Falseeven though the account is a registered epic games account ifClient.fetch_user_data_in_eventsis set toFalse.- Type:
- 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_eventsset toFalse.- 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.
Noneis 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 leaderboardHTTPException – An error occurred while requesting.
- Returns:
An object representing the stats for this user.
- Return type:
- 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 leaderboardHTTPException – An error occurred while requesting.
- Returns:
An object representing the stats collection for this user.
- Return type:
- 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 inbound¶
Trueif this friend was the one to send the friend request elseFalse`. Aliased to ``inboundas well.- Type:
- property incoming¶
Trueif this friend was the one to send the friend request elseFalse`. Aliased to ``inboundas well.- Type:
- property jid¶
The JID of the user.
- Type:
- property outbound¶
Trueif the bot was the one to send the friend request elseFalse. Aliased tooutboundas well.- Type:
- property outgoing¶
Trueif the bot was the one to send the friend request elseFalse. Aliased tooutboundas well.- Type:
IncomingPendingFriend¶
- awaitaccept()
- awaitblock()
- awaitdecline()
- awaitfetch()
- awaitfetch_battlepass_level()
- awaitfetch_br_stats()
- awaitfetch_br_stats_collection()
- awaitfetch_event_tokens()
- awaitfetch_flag()
- awaitfetch_ranked_stats()
- 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:
- 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:
- 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:
- 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
NoneifClient.fetch_user_data_in_eventsis set toFalse.- Type:
Optional[
str]
- property epicgames_account¶
Tells you if the user is an account registered to epicgames services.
Falseif 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
Falseeven though the account is a registered epic games account ifClient.fetch_user_data_in_eventsis set toFalse.- Type:
- 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_eventsset toFalse.- 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.
Noneis 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 leaderboardHTTPException – An error occurred while requesting.
- Returns:
An object representing the stats for this user.
- Return type:
- 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 leaderboardHTTPException – An error occurred while requesting.
- Returns:
An object representing the stats collection for this user.
- Return type:
- 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 inbound¶
Trueif this friend was the one to send the friend request elseFalse`. Aliased to ``inboundas well.- Type:
- property incoming¶
Trueif this friend was the one to send the friend request elseFalse`. Aliased to ``inboundas well.- Type:
- property jid¶
The JID of the user.
- Type:
- property outbound¶
Trueif the bot was the one to send the friend request elseFalse. Aliased tooutboundas well.- Type:
- property outgoing¶
Trueif the bot was the one to send the friend request elseFalse. Aliased tooutboundas well.- Type:
OutgoingPendingFriend¶
- awaitabort()
- awaitblock()
- awaitcancel()
- awaitfetch()
- awaitfetch_battlepass_level()
- awaitfetch_br_stats()
- awaitfetch_br_stats_collection()
- awaitfetch_event_tokens()
- awaitfetch_flag()
- awaitfetch_ranked_stats()
- 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:
- 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:
- 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
NoneifClient.fetch_user_data_in_eventsis set toFalse.- Type:
Optional[
str]
- property epicgames_account¶
Tells you if the user is an account registered to epicgames services.
Falseif 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
Falseeven though the account is a registered epic games account ifClient.fetch_user_data_in_eventsis set toFalse.- Type:
- 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_eventsset toFalse.- 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.
Noneis 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 leaderboardHTTPException – An error occurred while requesting.
- Returns:
An object representing the stats for this user.
- Return type:
- 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 leaderboardHTTPException – An error occurred while requesting.
- Returns:
An object representing the stats collection for this user.
- Return type:
- 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 inbound¶
Trueif this friend was the one to send the friend request elseFalse`. Aliased to ``inboundas well.- Type:
- property incoming¶
Trueif this friend was the one to send the friend request elseFalse`. Aliased to ``inboundas well.- Type:
- property jid¶
The JID of the user.
- Type:
- property outbound¶
Trueif the bot was the one to send the friend request elseFalse. Aliased tooutboundas well.- Type:
- property outgoing¶
Trueif the bot was the one to send the friend request elseFalse. Aliased tooutboundas well.- Type:
FriendMessage¶
- awaitreply()
PartyMessage¶
- awaitreply()
PartyMember¶
- backpack
- backpack_variants
- banner
- battlepass_info
- client
- contrail
- contrail_variants
- disabled
- display_name
- emoji
- emote
- enlightenments
- epicgames_account
- external_auths
- has_crown
- hidden
- id
- input
- jam
- jid
- joined_at
- kicks
- kicks_variants
- leader
- lobby_map_marker_coordinates
- match_players_left
- match_started_at
- matchmaking_info
- offline_ttl
- outfit
- outfit_variants
- party
- pet
- pickaxe
- pickaxe_variants
- platform
- playlist_selection
- position
- power_level
- rank
- ready
- scratchpad
- sidekick
- sidekick_variants
- victory_crowns
- will_yield_leadership
- zombie_since
- create_variant()
- create_variants()
- in_match()
- is_ready()
- is_zombie()
- lobby_map_marker_is_visible()
- awaitadd()
- awaitblock()
- awaitfetch()
- awaitfetch_battlepass_level()
- awaitfetch_br_stats()
- awaitfetch_br_stats_collection()
- awaitfetch_event_tokens()
- awaitfetch_flag()
- awaitfetch_ranked_stats()
- awaitkick()
- awaitpromote()
- awaitswap_position()
- class rebootpy.PartyMember[source]¶
Represents a party member.
- 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
1000but 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
700total 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.
Noneif no backpack is equipped.- Type:
- 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
variantskeyword toClientPartyMember.set_backpack().- Type:
- property banner¶
A tuple consisting of the icon id, color id and the season level.
Example output:
('standardbanner1', 'defaultcolor1')
- Type:
- property battlepass_info¶
A tuple consisting of has purchased and battlepass level.
Example output:
(True, 30)
- Type:
- async block()¶
This function is a coroutine.
Blocks this user.
- Raises:
HTTPException – Something went wrong while blocking this user.
- 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
variantskeyword toClientPartyMember.set_contrail().- Type:
- 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 beProfileBanner.
- 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 beProfileBanner.
- 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:
- 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
NoneifClient.fetch_user_data_in_eventsis set toFalse.- Type:
Optional[
str]
- property emoji¶
The ID of the emoji this member is currently playing.
Noneif no emoji is currently playing.- Type:
Optional[
str]
- property emote¶
The EID of the emote this member is currently playing.
Noneif 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.
Falseif 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
Falseeven though the account is a registered epic games account ifClient.fetch_user_data_in_eventsis set toFalse.- Type:
- 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_eventsset toFalse.- 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.
Noneis 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 leaderboardHTTPException – An error occurred while requesting.
- Returns:
An object representing the stats for this user.
- Return type:
- 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 leaderboardHTTPException – An error occurred while requesting.
- Returns:
An object representing the stats collection for this user.
- Return type:
- 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]
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:
- in_match()¶
Whether or not this member is currently in a match.
- Returns:
Trueif this member is in a match elseFalse.- Return type:
- is_ready()¶
Whether or not this member is ready.
- Returns:
Trueif this member is ready elseFalse.- Return type:
- 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.
Noneif no jam is currently playing.- Type:
Optional[
str]
- property jid¶
The JID of the user.
- Type:
- property joined_at¶
The UTC time of when this member joined its party.
- Type:
- 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
variantskeyword toClientPartyMember.set_kicks().- Type:
- 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
- lobby_map_marker_is_visible()¶
Whether or not this members lobby map marker is currently visible.
- Returns:
Trueif this members lobby map marker is currently visible elseFalse.- Return type:
- 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
0if not in a match.- Return type:
- property match_started_at¶
The time in UTC that the members match started.
Noneif not in a match.- Type:
Optional[
datetime.datetime]
- property matchmaking_info¶
The members matchmaking info.
- Type:
- property offline_ttl¶
The amount of time this member will stay in a zombie mode before expiring.
- Type:
- 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
variantskeyword toClientPartyMember.set_outfit().- Type:
- 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.
Noneif no pet is equipped.- Type:
- 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
variantskeyword toClientPartyMember.set_pickaxe().- Type:
- 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:
- 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 14-7 = Team 28-11 = Team 312-15 = Team 4- Type:
- 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:
- property ready¶
The members ready state.
- Type:
- 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
variantskeyword toClientPartyMember.set_sidekick().- Type:
- 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:
- property zombie_since¶
The utc datetime this member went into a zombie state.
Noneif this user is currently not a zombie.- Type:
Optional[
datetime.datetime]
ClientPartyMember¶
- backpack
- backpack_variants
- banner
- battlepass_info
- client
- contrail
- contrail_variants
- disabled
- display_name
- emoji
- emote
- enlightenments
- epicgames_account
- external_auths
- has_crown
- hidden
- id
- input
- jam
- jid
- joined_at
- kicks
- kicks_variants
- leader
- lobby_map_marker_coordinates
- match_players_left
- match_started_at
- matchmaking_info
- offline_ttl
- outfit
- outfit_variants
- party
- pet
- pickaxe
- pickaxe_variants
- platform
- playlist_selection
- position
- power_level
- rank
- ready
- scratchpad
- sidekick
- sidekick_variants
- victory_crowns
- will_yield_leadership
- zombie_since
- create_variant()
- create_variants()
- in_match()
- is_ready()
- is_zombie()
- lobby_map_marker_is_visible()
- awaitadd()
- awaitblock()
- awaitclear_backpack()
- awaitclear_contrail()
- awaitclear_emote()
- awaitclear_in_match()
- awaitclear_kicks()
- awaitclear_lobby_map_marker()
- awaitclear_pet()
- awaitclear_sidekick()
- awaitclear_sidekick_emote()
- awaitedit()
- awaitedit_and_keep()
- awaitequip_crown()
- awaitfetch()
- awaitfetch_battlepass_level()
- awaitfetch_br_stats()
- awaitfetch_br_stats_collection()
- awaitfetch_event_tokens()
- awaitfetch_flag()
- awaitfetch_ranked_stats()
- awaitleave()
- awaitset_backpack()
- awaitset_backpack_rating()
- awaitset_banner()
- awaitset_battlepass_info()
- awaitset_contrail()
- awaitset_emoji()
- awaitset_emote()
- awaitset_fort_stats()
- awaitset_hero_loadout_rating()
- awaitset_in_match()
- awaitset_instruments()
- awaitset_jam_emote()
- awaitset_kicks()
- awaitset_lobby_map_marker()
- awaitset_outfit()
- awaitset_pet()
- awaitset_pickaxe()
- awaitset_position()
- awaitset_power_level()
- awaitset_ready()
- awaitset_sidekick()
- awaitset_sidekick_emote()
- awaitset_victory_crowns()
- class rebootpy.ClientPartyMember[source]¶
Represents the clients party member.
- 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. UnlikeClientPartyMember.edit(), this method only takes coroutines in the form of afunctools.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:
- 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 toNonewhich 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
Nonewhich 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
Nonewhich 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
Nonewhich 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
Nonewhich 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 withPartyMember.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
sidwitheidand then add either_vox,_drum,_leador_bassto the end depending on what instrument you want to use. e.g.sid_placeholder_10becomessid_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 withPartyMember.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.Nonemeans it will run indefinitely and you can then clear it withPartyMember.clear_emote(). Defaults to2seconds 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 whenPartyMember.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.Nonemeans it will run indefinitely and you can then clear it withPartyMember.clear_sidekick_emote(). Defaults to2seconds 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 whenPartyMember.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:
- 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:
- 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:
ValueError – The passed position is out of bounds.
HTTPException – An error occurred while requesting.
- 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:
- 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
1000but 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
700total 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.
Noneif no backpack is equipped.- Type:
- 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
variantskeyword toClientPartyMember.set_backpack().- Type:
- property banner¶
A tuple consisting of the icon id, color id and the season level.
Example output:
('standardbanner1', 'defaultcolor1')
- Type:
- property battlepass_info¶
A tuple consisting of has purchased and battlepass level.
Example output:
(True, 30)
- Type:
- async block()¶
This function is a coroutine.
Blocks this user.
- Raises:
HTTPException – Something went wrong while blocking this user.
- 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
variantskeyword toClientPartyMember.set_contrail().- Type:
- 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 beProfileBanner.
- 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 beProfileBanner.
- 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:
- 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
NoneifClient.fetch_user_data_in_eventsis set toFalse.- Type:
Optional[
str]
- property emoji¶
The ID of the emoji this member is currently playing.
Noneif no emoji is currently playing.- Type:
Optional[
str]
- property emote¶
The EID of the emote this member is currently playing.
Noneif 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.
Falseif 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
Falseeven though the account is a registered epic games account ifClient.fetch_user_data_in_eventsis set toFalse.- Type:
- 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_eventsset toFalse.- 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.
Noneis 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 leaderboardHTTPException – An error occurred while requesting.
- Returns:
An object representing the stats for this user.
- Return type:
- 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 leaderboardHTTPException – An error occurred while requesting.
- Returns:
An object representing the stats collection for this user.
- Return type:
- 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]
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:
- in_match()¶
Whether or not this member is currently in a match.
- Returns:
Trueif this member is in a match elseFalse.- Return type:
- is_ready()¶
Whether or not this member is ready.
- Returns:
Trueif this member is ready elseFalse.- Return type:
- 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.
Noneif no jam is currently playing.- Type:
Optional[
str]
- property jid¶
The JID of the user.
- Type:
- property joined_at¶
The UTC time of when this member joined its party.
- Type:
- 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
variantskeyword toClientPartyMember.set_kicks().- Type:
- 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
- lobby_map_marker_is_visible()¶
Whether or not this members lobby map marker is currently visible.
- Returns:
Trueif this members lobby map marker is currently visible elseFalse.- Return type:
- 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
0if not in a match.- Return type:
- property match_started_at¶
The time in UTC that the members match started.
Noneif not in a match.- Type:
Optional[
datetime.datetime]
- property matchmaking_info¶
The members matchmaking info.
- Type:
- property offline_ttl¶
The amount of time this member will stay in a zombie mode before expiring.
- Type:
- 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
variantskeyword toClientPartyMember.set_outfit().- Type:
- 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.
Noneif no pet is equipped.- Type:
- 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
variantskeyword toClientPartyMember.set_pickaxe().- Type:
- 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:
- 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 14-7 = Team 28-11 = Team 312-15 = Team 4- Type:
- 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:
- property ready¶
The members ready state.
- Type:
- 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
variantskeyword toClientPartyMember.set_sidekick().- Type:
- 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:
- property zombie_since¶
The utc datetime this member went into a zombie state.
Noneif this user is currently not a zombie.- Type:
Optional[
datetime.datetime]
Party¶
- get_member()
- awaitjoin()
- 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:
- get_member(user_id)¶
Optional[
PartyMember]: Attempts to get a party member from the member cache. ReturnsNoneif no user was found by the user id.
- property leader¶
The leader of the party.
- Type:
- 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:
- property privacy¶
The currently set privacy of this party.
- Type:
- property squad_assignments¶
The squad assignments for this party. This includes information about a members position and visibility.
- Type:
Dict[
PartyMember,SquadAssignment]
ClientParty¶
- get_member()
- awaitedit()
- awaitedit_and_keep()
- awaitfetch_invites()
- awaitinvite()
- awaitsend()
- awaitset_custom_key()
- awaitset_fill()
- awaitset_max_size()
- awaitset_playlist()
- awaitset_privacy()
- awaitset_region()
- awaitset_squad_assignments()
- class rebootpy.ClientParty[source]¶
Represents ClientUser’s party.
- property me¶
The clients partymember object.
- Type:
- 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
myawesomekeyand 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. UnlikeClientParty.edit(), this method only takes coroutines in the form of afunctools.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:
- 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, )
- 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' )
- get_member(user_id)¶
Optional[
PartyMember]: Attempts to get a party member from the member cache. ReturnsNoneif no user was found by the user id.
- property leader¶
The leader of the party.
- Type:
- 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:
- property privacy¶
The currently set privacy of this party.
- Type:
- property squad_assignments¶
The squad assignments for this party. This includes information about a members position and visibility.
- Type:
Dict[
PartyMember,SquadAssignment]
ReceivedPartyInvitation¶
- class rebootpy.ReceivedPartyInvitation[source]¶
Represents a received party invitation.
- created_at¶
The UTC time this invite was created at.
- Type:
- 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:
- 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¶
- class rebootpy.SentPartyInvitation[source]¶
Represents a sent party invitation.
- sender¶
The party member that sent the invite.
- Type:
- created_at¶
The UTC time this invite was created at.
- Type:
- 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¶
- class rebootpy.PartyJoinConfirmation[source]¶
Represents a join confirmation.
- party¶
The party the user wants to join.
- Type:
- created_at¶
The UTC time of when the join confirmation was received.
- Type:
- 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¶
- awaitaccept()
- 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.
- party¶
The party the user wants to join.
- Type:
- created_at¶
The UTC timestamp of when this join request was created.
- Type:
- expires_at¶
The UTC timestamp of when this join request will expire. This should always be one minute after its creation.
- Type:
- 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:
PartyError – User is already in your party.
PartyError – The party is full.
HTTPException – An error occurred while requesting.
Presence¶
- class rebootpy.Presence[source]¶
Represents a presence received from a friend
- available¶
Whether or not the user is online.
Trueif the friend is or went online,Falseif the friend went offline.- Type:
- away¶
The users away status.
- Type:
- received_at¶
The UTC time of when the client received this presence.
- Type:
- session_id¶
The friend’s current session id. Often referred to as server key or game key. Returns
Noneif the friend is not currently in a game.- Type:
- has_properties¶
Trueif the presence has properties elseFalse.Warning
All attributes below this point will be
Noneifhas_propertiesisFalse.- Type:
- party¶
The friend’s party.
- Type:
- gameplay_stats¶
The friend’s gameplay stats. Will be
Noneif no gameplay stats are currently available.- Type:
Optional[
PresenceGameplayStats]
PresenceParty¶
- awaitjoin()
- 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.- 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:
PresenceGameplayStats¶
- class rebootpy.PresenceGameplayStats[source]¶
Represents gameplaystats received from presence.
- state¶
The state.
Note
It’s not really known what value this property might hold. This is pretty much always an empty string.
- Type:
- playlist¶
The playlist.
Note
The playlist from the gameplay stats property usually isn’t updated. Consider using
Presence.playlistinstead as that seems to always be the correct playlist.- Type:
- kills¶
The amount of kills the friend currently has. Aliased to
num_killsas well for legacy reasons.- Type:
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'])
- 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'])
- 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:
- get_combined_stats(platforms=True)[source]¶
Gets combined stats for this user.
- Parameters:
platforms (
bool) –Trueif the combined stats should be mapped to theirrespective region. |
Falseto 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:
StatsCollection¶
BattleRoyaleNewsPost¶
Store¶
- class rebootpy.Store[source]¶
Object representing store data from Fortnite Battle Royale.
- property daily_purchase_hours¶
How many hours a day it is possible to purchase items. It most likely is
24.- Type:
- property created_at¶
The UTC time of the creation and current day.
- Type:
- property expires_at¶
The UTC time of when this item shop expires.
- Type:
StoreItem¶
- class rebootpy.StoreItem[source]¶
Featured store item.
- property asset¶
The asset of the item. Usually a CID or or something similar. Could be
Noneif not found.- Type:
- property encryption_key¶
The encryption key for this item. If no encryption key is found, this will be
None.- Type:
- 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:
- property violator¶
The violator of this item. Violator is the red tag at the top of an item in the shop. Will be
Noneif no violator is found for this item.- Type:
Playlist¶
- class rebootpy.Playlist[source]¶
-
- property special_border¶
Special border of the playlist. Will be
Noneif 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
Noneif no violator is found for this playlist.- Type:
Optional[
str]
CreativeIsland¶
- class rebootpy.CreativeIsland[source]¶
Creative island.
- property created¶
The UTC time the island was created.
- Type:
- property published¶
The UTC time the island was published.
- Type:
- property lobby_background_image¶
The image URL of the lobby background, if none Fortnite will use the default.
- Type:
- property ratings¶
A list containing data about all age ratings for the island.
- Type:
List[
CreativeIslandRating]
CreativeIslandRating¶
CompetitiveRank¶
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.PUBLICmax_size (Optional[
int]) –The maximum party size. Valid party sizes must use a valuebetween 1 and 16. | Defaults to
16chat_enabled (Optional[
bool]) –Whether or not the party chat should be enabled for the party.Defaults toTrue.team_change_allowed (
bool) –Whether or not players should be able to manually swap party teamwith another player. This setting only works if the client is the leader of the party. | Defaults to
Truedefault_squad_assignment (
SquadAssignment) –The default squad assignment to use for new members. Squad assignmentsholds 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 memberjoins 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 partysize changes. Set this to
Falseif you want members to keep their positions unless manually changed. The reassignment is done according to the position priorities. | Defaults toTrue.joinability (Optional[
PartyJoinability]) –The joinability configuration that should be used.Defaults toPartyJoinability.OPENdiscoverability (Optional[
PartyDiscoverability]) –The discoverability configuration that should be used.Defaults toPartyDiscoverability.ALLinvite_ttl (Optional[
int]) –How many seconds the invite should be valid for beforeautomatically becoming invalid. | Defaults to
14400intention_ttl (Optional[
int]) –How many seconds an intention should last.Defaults to60sub_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 canspecify 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:
- default_squad_assignment¶
The default squad assignment to use for new members and members not specified in manual squad assignments requests.
- Type:
- 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:
- 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 fromClientPartyMember. 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 toFalseoffline_ttl (
int) – How long the client should stay in the party disconnected state before expiring when the xmpp connection is lost. Defaults to30.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:
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. IfNonethis is ignored. Defaults to65.handle_rate_limits (
bool) –Whether or not the client should handle rate limit errors and wait the received
Retry-Afterbefore automatically retrying the request. Defaults toTrue.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 originalHTTPExceptionis 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 toTrue. 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 toTrue.backoff_start (
float) – The initial seconds to wait for the exponential backoff. Defaults to1. Only matters when ``handle_capacity_throttling`` is ``True``backoff_factor (
float) – The multiplying factor used for the exponential backoff when a request fails. Defaults to1.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 to20. 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
BASEand optionallyAUTHshould 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. IfNonethe default auth specified for the route is used.**params (Any) – The variables to format the path with passed alongside their name.
Avatar¶
- class rebootpy.Avatar[source]¶
Represents a friend’s avatar. This is always related to the outfit the friend has equipped.
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:
- 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:
- validation_failures¶
A list containing information about the validation failures.
Noneif the error was not raised a validation issue.- Type:
Optional[List[
ValidationFailure]]
- 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.