From 02e1e9e0a2b54f997f940025196ea06b2b7943af Mon Sep 17 00:00:00 2001 From: Oli <55298769+xMistt@users.noreply.github.com> Date: Sun, 20 Aug 2023 01:21:09 +0100 Subject: [PATCH 1/9] fix downloads --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e2fc8a1..e4e1256 100755 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@

- Downloads + Downloads Python From ecd86e981489cdbdc784b34c4b3e6577b57bf3be Mon Sep 17 00:00:00 2001 From: OMKAR MAKHARE Date: Wed, 18 Oct 2023 11:08:47 +0530 Subject: [PATCH 2/9] Update README.md Corrected "offical" to "official" in the README.md file. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e4e1256..4813966 100755 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ --- -## Offical Website +## official Website [PartyBot.net](https://partybot.net) ## Discord Support From 3038060292aaca76be5217510f27ab21cf7ada8d Mon Sep 17 00:00:00 2001 From: Oli <55298769+xMistt@users.noreply.github.com> Date: Fri, 5 Jan 2024 10:44:42 +0000 Subject: [PATCH 3/9] happy new year gang --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index e9b1d45..e647d15 100755 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ “Commons Clause” License Condition v1.0 -Copyright Oli 2019-2023 +Copyright Oli 2019-2024 The Software is provided to you by the Licensor under the License, as defined below, subject to the following condition. From a083cc97cbfdc07026acc0438be8c78b5c9ef8c2 Mon Sep 17 00:00:00 2001 From: Lilith Asami <45718226+LilithLovesYou@users.noreply.github.com> Date: Fri, 29 Mar 2024 08:10:47 +1000 Subject: [PATCH 4/9] Added all max tier skins --- partybot/cosmetic.py | 2718 +++++++++++++++++++++--------------------- 1 file changed, 1365 insertions(+), 1353 deletions(-) diff --git a/partybot/cosmetic.py b/partybot/cosmetic.py index 1ef0ce6..ce0370b 100644 --- a/partybot/cosmetic.py +++ b/partybot/cosmetic.py @@ -1,1354 +1,1366 @@ -""" -“Commons Clause” License Condition v1.0 -Copyright Oli 2019-2023 - -The Software is provided to you by the Licensor under the -License, as defined below, subject to the following condition. - -Without limiting other conditions in the License, the grant -of rights under the License will not include, and the License -does not grant to you, the right to Sell the Software. - -For purposes of the foregoing, “Sell” means practicing any or -all of the rights granted to you under the License to provide -to third parties, for a fee or other consideration (including -without limitation fees for hosting or consulting/ support -services related to the Software), a product or service whose -value derives, entirely or substantially, from the functionality -of the Software. Any license notice or attribution required by -the License must also include this Commons Clause License -Condition notice. - -Software: PartyBot (fortnitepy-bot) - -License: Apache 2.0 -""" - -# System imports. -import asyncio -import functools - -from typing import Optional, Union, Tuple - -# Third party imports. -import fortnitepy -import aiohttp -import FortniteAPIAsync -import random as py_random - -from fortnitepy.ext import commands - - -class CosmeticCommands(commands.Cog): - def __init__(self, bot: commands.Bot) -> None: - self.bot = bot - - # async def set_vtid(self, variant_token: str) -> Tuple[str, str, int]: - # async with aiohttp.ClientSession() as session: - # request = await session.request( - # method='GET', - # url='https://benbot.app/api/v1/assetProperties', - # params={ - # 'path': 'FortniteGame/Content/Athena/' - # f'Items/CosmeticVariantTokens/{variant_token}.uasset' - # }) - # - # response = await request.json() - # - # file_location = response['export_properties'][0] - # - # skin_cid = file_location['cosmetic_item'] - # variant_channel_tag = file_location['VariantChanelTag']['TagName'] - # variant_name_tag = file_location['VariantNameTag']['TagName'] - # - # variant_type = variant_channel_tag.split( - # 'Cosmetics.Variant.Channel.' - # )[1].split('.')[0] - # - # variant_int = int("".join(filter( - # lambda x: x.isnumeric(), variant_name_tag - # ))) - # - # return skin_cid, variant_type if variant_type != 'ClothingColor' else 'clothing_color', variant_int - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the outfit of the client using the outfits name.", - help="Sets the outfit of the client using the outfits name.\n" - "Example: !skin Nog Ops" - ) - async def skin(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: - try: - cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( - matchMethod="contains", - name=content, - backendType="AthenaCharacter" - ) - except FortniteAPIAsync.exceptions.NotFound: - print(self.bot.message % f"Failed to find a skin with the name: {content}.") - return await ctx.send(f"Failed to find a skin with the name: {content}.") - - if "brcosmetics" in cosmetic.path.lower(): - path = f"AthenaCharacterItemDefinition'/BRCosmetics/Athena/Items/Cosmetics/Characters/{cosmetic.id}.{cosmetic.id}'" - await self.bot.party.me.set_outfit(asset=path) - else: - await self.bot.party.me.set_outfit(asset=cosmetic.id) - - await ctx.send(f'Skin set to {cosmetic.id}.') - print(self.bot.message % f"Set skin to: {cosmetic.id}.") - - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the backpack of the client using the backpacks name.", - help="Sets the backpack of the client using the backpacks name.\n" - "Example: !backpack Black Shield" - ) - async def backpack(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: - try: - cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( - matchMethod="contains", - name=content, - backendType="AthenaBackpack" - ) - except FortniteAPIAsync.exceptions.NotFound: - await ctx.send(f"Failed to find a backpack with the name: {content}.") - print(self.bot.message % f"Failed to find a backpack with the name: {content}.") - - if "brcosmetics" in cosmetic.path.lower(): - path = f"AthenaCharacterItemDefinition'/BRCosmetics/Athena/Items/Cosmetics/Backpacks/{cosmetic.id}.{cosmetic.id}'" - await self.bot.party.me.set_backpack(asset=path) - else: - await self.bot.party.me.set_outfit(asset=cosmetic.id) - - await ctx.send(f'Backpack set to {cosmetic.id}.') - print(self.bot.message % f"Set backpack to: {cosmetic.id}.") - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the emote of the client using the emotes name.", - help="Sets the emote of the client using the emotes name.\n" - "Example: !emote Windmill Floss" - ) - async def emote(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: - try: - cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( - matchMethod="contains", - name=content, - backendType="AthenaDance" - ) - except FortniteAPIAsync.exceptions.NotFound: - await ctx.send(f"Failed to find an emote with the name: {content}.") - print(self.bot.message % f"Failed to find an emote with the name: {content}.") - - if "brcosmetics" in cosmetic.path.lower(): - path = f"AthenaCharacterItemDefinition'/BRCosmetics/Athena/Items/Cosmetics/Dances/{cosmetic.id}.{cosmetic.id}'" - await self.bot.party.me.clear_emote() - await self.bot.party.me.set_emote(asset=path) - else: - await self.bot.party.me.clear_emote() - await self.bot.party.me.set_emote(asset=cosmetic.id) - - await ctx.send(f'Emote set to {cosmetic.id}.') - print(self.bot.message % f"Set emote to: {cosmetic.id}.") - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the pickaxe of the client using the pickaxe name.", - help="Sets the pickaxe of the client using the pickaxe name.\n" - "Example: !pickaxe Raider's Revenge" - ) - async def pickaxe(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: - try: - cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( - lang="en", - searchLang="en", - matchMethod="contains", - name=content, - backendType="AthenaPickaxe" - ) - - await ctx.send(f'Pickaxe set to {cosmetic.id}.') - print(self.bot.message % f"Set pickaxe to: {cosmetic.id}.") - await self.bot.party.me.set_pickaxe(asset=cosmetic.id) - - except FortniteAPIAsync.exceptions.NotFound: - await ctx.send(f"Failed to find a pickaxe with the name: {content}.") - print(self.bot.message % f"Failed to find a pickaxe with the name: {content}.") - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the pet (backpack) of the client using the pets name.", - help="Sets the pet (backpack) of the client using the pets name.\n" - "Example: !pet Bonesy" - ) - async def pet(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: - try: - cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( - lang="en", - searchLang="en", - matchMethod="contains", - name=content, - backendType="AthenaPetCarrier" - ) - - await ctx.send(f'Pet set to {cosmetic.id}.') - print(self.bot.message % f"Set pet to: {cosmetic.id}.") - await self.bot.party.me.set_pet(asset=cosmetic.id) - - except FortniteAPIAsync.exceptions.NotFound: - await ctx.send(f"Failed to find a pet with the name: {content}.") - print(self.bot.message % f"Failed to find a pet with the name: {content}.") - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the emoji of the client using the emojis name.", - help="Sets the emoji of the client using the emojis name.\n" - "Example: !emoji Snowball" - ) - async def emoji(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: - try: - cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( - lang="en", - searchLang="en", - matchMethod="contains", - name=content, - backendType="AthenaEmoji" - ) - - await ctx.send(f'Emoji set to {cosmetic.id}.') - print(self.bot.message % f"Set emoji to: {cosmetic.id}.") - await self.bot.party.me.set_emoji(asset=cosmetic.id) - - except FortniteAPIAsync.exceptions.NotFound: - await ctx.send(f"Failed to find an emoji with the name: {content}.") - print(self.bot.message % f"Failed to find an emoji with the name: {content}.") - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the contrail of the client using the contrail name.", - help="Sets the contrail of the client using the contrail name.\n" - "Example: !contrail Holly And Divey" - ) - async def contrail(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: - try: - cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( - lang="en", - searchLang="en", - matchMethod="contains", - name=content, - backendType="AthenaSkyDiveContrail" - ) - - await ctx.send(f'Contrail set to {cosmetic.id}.') - print(self.bot.message % f"Set contrail to: {cosmetic.id}.") - await self.bot.party.me.set_contrail(asset=cosmetic.id) - - except FortniteAPIAsync.exceptions.NotFound: - await ctx.send(f"Failed to find a contrail with the name: {content}.") - print(self.bot.message % f"Failed to find an contrail with the name: {content}.") - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the outfit of the client to Purple Skull Trooper.", - help="Sets the outfit of the client to Purple Skull Trooper.\n" - "Example: !purpleskull" - ) - async def purpleskull(self, ctx: fortnitepy.ext.commands.Context) -> None: - skin_variants = self.bot.party.me.create_variants( - clothing_color=1 - ) - - await self.bot.party.me.set_outfit( - asset='CID_030_Athena_Commando_M_Halloween', - variants=skin_variants - ) - - await ctx.send('Skin set to Purple Skull Trooper!') - print(self.bot.message % f"Skin set to Purple Skull Trooper.") - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the outfit of the client to Pink Ghoul Trooper.", - help="Sets the outfit of the client to Pink Ghoul Trooper.\n" - "Example: !pinkghoul" - ) - async def pinkghoul(self, ctx: fortnitepy.ext.commands.Context) -> None: - skin_variants = self.bot.party.me.create_variants( - material=3 - ) - - await self.bot.party.me.set_outfit( - asset='CID_029_Athena_Commando_F_Halloween', - variants=skin_variants - ) - - await ctx.send('Skin set to Pink Ghoul Trooper!') - print(self.bot.message % f"Skin set to Pink Ghoul Trooper.") - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the backpack of the client to Purple Ghost Portal.", - help="Sets the backpack of the client to Purple Ghost Portal.\n" - "Example: !purpleportal" - ) - async def purpleportal(self, ctx: fortnitepy.ext.commands.Context) -> None: - skin_variants = self.bot.party.me.create_variants( - config_overrides={ - 'particle': 'Particle{}' - }, - particle=1 - ) - - await self.bot.party.me.set_backpack( - asset='BID_105_GhostPortal', - variants=skin_variants - ) - - await ctx.send('Backpack set to Purple Ghost Portal!') - print(self.bot.message % f"Backpack set to Purple Ghost Portal.") - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the outfit of the client using CID.", - help="Sets the outfit of the client using CID.\n" - "Example: !cid CID_047_Athena_Commando_F_HolidayReindeer" - ) - async def cid(self, ctx: fortnitepy.ext.commands.Context, character_id: str) -> None: - await self.bot.party.me.set_outfit( - asset=character_id, - variants=self.bot.party.me.create_variants(profile_banner='ProfileBanner') - ) - - await ctx.send(f'Skin set to {character_id}.') - print(self.bot.message % f'Skin set to {character_id}.') - - # NOTE: Command is currently not possible due to no APIs allowing you to browse the files, hope to fix eventually. - # @commands.dm_only() - # @commands.command( - # description="[Cosmetic] Creates the variants list by the variants you set using VTID.", - # help="Creates the variants list by the variants you set using VTID.\n" - # "Example: !vtid VTID_052_Skull_Trooper_RedFlames" - # ) - # async def vtid(self, ctx: fortnitepy.ext.commands.Context, variant_token: str) -> None: - # variant_id = await self.set_vtid(variant_token) - # - # if variant_id[1].lower() == 'particle': - # skin_variants = self.bot.party.me.create_variants(config_overrides={'particle': 'Particle{}'}, particle=1) - # else: - # skin_variants = self.bot.party.me.create_variants(**{variant_id[1].lower(): int(variant_id[2])}) - # - # await self.bot.party.me.set_outfit(asset=variant_id[0], variants=skin_variants) - # print(self.bot.message % f'Set variants of {variant_id[0]} to {variant_id[1]} {variant_id[2]}.') - # await ctx.send(f'Variants set to {variant_token}.\n' - # '(Warning: This feature is not supported, please use !variants)') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Creates the variants list by the variants you set.", - help="Creates the variants list by the variants you set.\n" - "Example: !variants CID_030_Athena_Commando_M_Halloween clothing_color 1" - ) - async def variants(self, ctx: fortnitepy.ext.commands.Context, cosmetic_id: str, variant_type: str, - variant_int: str) -> None: - if 'cid' in cosmetic_id.lower() and 'jersey_color' not in variant_type.lower(): - skin_variants = self.bot.party.me.create_variants( - **{variant_type: int(variant_int) if variant_int.isdigit() else variant_int} - ) - - await self.bot.party.me.set_outfit( - asset=cosmetic_id, - variants=skin_variants - ) - - elif 'cid' in cosmetic_id.lower() and 'jersey_color' in variant_type.lower(): - cosmetic_variants = self.bot.party.me.create_variants( - pattern=0, - numeric=69, - **{variant_type: int(variant_int) if variant_int.isdigit() else variant_int} - ) - - await self.bot.party.me.set_outfit( - asset=cosmetic_id, - variants=cosmetic_variants - ) - - elif 'bid' in cosmetic_id.lower(): - cosmetic_variants = self.bot.party.me.create_variants( - **{variant_type: int(variant_int) if variant_int.isdigit() else variant_int} - ) - - await self.bot.party.me.set_backpack( - asset=cosmetic_id, - variants=cosmetic_variants - ) - elif 'pickaxe_id' in cosmetic_id.lower(): - cosmetic_variants = self.bot.party.me.create_variants( - **{variant_type: int(variant_int) if variant_int.isdigit() else variant_int} - ) - - await self.bot.party.me.set_pickaxe( - asset=cosmetic_id, - variants=cosmetic_variants - ) - - await ctx.send(f'Set variants of {cosmetic_id} to {variant_type} {variant_int}.') - print(self.bot.message % f'Set variants of {cosmetic_id} to {variant_type} {variant_int}.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the outfit of the client to Checkered Renegade.", - help="Sets the outfit of the client to Checkered Renegade.\n" - "Example: !checkeredrenegade" - ) - async def checkeredrenegade(self, ctx: fortnitepy.ext.commands.Context) -> None: - skin_variants = self.bot.party.me.create_variants( - material=2 - ) - - await self.bot.party.me.set_outfit( - asset='CID_028_Athena_Commando_F', - variants=skin_variants - ) - - await ctx.send('Skin set to Checkered Renegade!') - print(self.bot.message % f'Skin set to Checkered Renegade.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the outfit of the client to Minty Elf.", - help="Sets the outfit of the client to Minty Elf.\n" - "Example: !mintyelf" - ) - async def mintyelf(self, ctx: fortnitepy.ext.commands.Context) -> None: - skin_variants = self.bot.party.me.create_variants( - material=2 - ) - - await self.bot.party.me.set_outfit( - asset='CID_051_Athena_Commando_M_HolidayElf', - variants=skin_variants - ) - - await ctx.send('Skin set to Minty Elf!') - print(self.bot.message % f'Skin set to Minty Elf.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the emote of the client using EID.", - help="Sets the emote of the client using EID.\n" - "Example: !eid EID_Floss" - ) - async def eid(self, ctx: fortnitepy.ext.commands.Context, emote_id: str) -> None: - await self.bot.party.me.clear_emote() - await self.bot.party.me.set_emote( - asset=emote_id - ) - - await ctx.send(f'Emote set to {emote_id}!') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Clears/stops the emote currently playing.", - help="Clears/stops the emote currently playing.\n" - "Example: !stop" - ) - async def stop(self, ctx: fortnitepy.ext.commands.Context) -> None: - await self.bot.party.me.clear_emote() - await ctx.send('Stopped emoting.') - print(self.bot.message % f'Stopped emoting.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the backpack of the client using BID.", - help="Sets the backpack of the client using BID.\n" - "Example: !bid BID_023_Pinkbear" - ) - async def bid(self, ctx: fortnitepy.ext.commands.Context, backpack_id: str) -> None: - await self.bot.party.me.set_backpack( - asset=backpack_id - ) - - await ctx.send(f'Backbling set to {backpack_id}!') - print(self.bot.message % f'Backbling set to {backpack_id}!') - - @commands.dm_only() - @commands.command( - aliases=['legacypickaxe'], - description="[Cosmetic] Sets the pickaxe of the client using PICKAXE_ID", - help="Sets the pickaxe of the client using PICKAXE_ID\n" - "Example: !pickaxe_id Pickaxe_ID_073_Balloon" - ) - async def pickaxe_id(self, ctx: fortnitepy.ext.commands.Context, pickaxe_id_: str) -> None: - await self.bot.party.me.set_pickaxe( - asset=pickaxe_id_ - ) - - await ctx.send(f'Pickaxe set to {pickaxe_id_}') - print(self.bot.message % f'Pickaxe set to {pickaxe_id_}') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the pet of the client using PetCarrier_.", - help="Sets the pet of the client using PetCarrier_.\n" - "Example: !pet_carrier PetCarrier_002_Chameleon" - ) - async def pet_carrier(self, ctx: fortnitepy.ext.commands.Context, pet_carrier_id: str) -> None: - await self.bot.party.me.set_pet( - asset=pet_carrier_id - ) - - await ctx.send(f'Pet set to {pet_carrier_id}!') - print(self.bot.message % f'Pet set to {pet_carrier_id}!') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the emoji of the client using Emoji_.", - help="Sets the emoji of the client using Emoji_.\n" - "Example: !emoji_id Emoji_PeaceSign" - ) - async def emoji_id(self, ctx: fortnitepy.ext.commands.Context, emoji_: str) -> None: - await self.bot.party.me.clear_emote() - await self.bot.party.me.set_emoji( - asset=emoji_ - ) - - await ctx.send(f'Emoji set to {emoji_}!') - print(self.bot.message % f'Emoji set to {emoji_}!') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the contrail of the client using Trails_.", - help="Sets the contrail of the client using Trails_.\n" - "Example: !trails Trails_ID_075_Celestial" - ) - async def trails(self, ctx: fortnitepy.ext.commands.Context, trails_: str) -> None: - await self.bot.party.me.set_contrail( - asset=trails_ - ) - - await ctx.send(f'Contrail set to {trails}!') - print(self.bot.message % f'Contrail set to {trails}!') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets pickaxe using PICKAXE_ID or display name & does 'Point it Out'. If no pickaxe is " - "specified, only the emote will be played.", - help="Sets pickaxe using PICKAXE_ID or display name & does 'Point it Out'. If no pickaxe is " - "specified, only the emote will be played.\n" - "Example: !point Pickaxe_ID_029_Assassin" - ) - async def point(self, ctx: fortnitepy.ext.commands.Context, *, content: Optional[str] = None) -> None: - if content is None: - await self.bot.party.me.set_emote(asset='EID_None') - await self.bot.party.me.set_emote(asset='EID_IceKing') - await ctx.send(f'Point it Out played.') - elif 'pickaxe_id' in content.lower(): - await self.bot.party.me.set_pickaxe(asset=content) - await self.bot.party.me.set_emote(asset='EID_None') - await self.bot.party.me.set_emote(asset='EID_IceKing') - await ctx.send(f'Pickaxe set to {content} & Point it Out played.') - else: - try: - cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( - lang="en", - searchLang="en", - matchMethod="contains", - name=content, - backendType="AthenaPickaxe" - ) - - await self.bot.party.me.set_pickaxe(asset=cosmetic.id) - await self.bot.party.me.set_emote(asset='EID_None') - await self.bot.party.me.set_emote(asset='EID_IceKing') - await ctx.send(f'Pickaxe set to {content} & Point it Out played.') - except FortniteAPIAsync.exceptions.NotFound: - await ctx.send(f"Failed to find a pickaxe with the name: {content}") - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Copies the cosmetic loadout of the defined user. If user is left blank, " - "the message author will be used.", - help="Copies the cosmetic loadout of the defined user. If user is left blank, " - "the message author will be used.\n" - "Example: !copy Terbau" - ) - async def copy(self, ctx: fortnitepy.ext.commands.Context, *, epic_username: Optional[str] = None) -> None: - if epic_username is None: - member = [m for m in self.bot.party.members if m.id == ctx.author.id][0] - else: - user = await self.bot.fetch_user(epic_username) - member = [m for m in self.bot.party.members if m.id == user.id][0] - - await self.bot.party.me.edit( - functools.partial( - fortnitepy.ClientPartyMember.set_outfit, - asset=member.outfit, - variants=member.outfit_variants - ), - functools.partial( - fortnitepy.ClientPartyMember.set_backpack, - asset=member.backpack, - variants=member.backpack_variants - ), - functools.partial( - fortnitepy.ClientPartyMember.set_pickaxe, - asset=member.pickaxe, - variants=member.pickaxe_variants - ), - functools.partial( - fortnitepy.ClientPartyMember.set_banner, - icon=member.banner[0], - color=member.banner[1], - season_level=member.banner[2] - ), - functools.partial( - fortnitepy.ClientPartyMember.set_battlepass_info, - has_purchased=True, - level=member.battlepass_info[1] - ) - ) - - if member.emote is not None: - await self.bot.party.me.set_emote(asset=member.emote) - - await ctx.send(f'Copied the loadout of {member.display_name}.') - print(self.bot.message % f'Copied the loadout of {member.display_name}.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Shortcut for equipping the skin CID_VIP_Athena_Commando_M_GalileoGondola_SG.", - help="Shortcut for equipping the skin CID_VIP_Athena_Commando_M_GalileoGondola_SG.\n" - "Example: !hologram" - ) - async def hologram(self, ctx: fortnitepy.ext.commands.Context) -> None: - await self.bot.party.me.set_outfit( - asset='CID_VIP_Athena_Commando_M_GalileoGondola_SG' - ) - - await ctx.send('Skin set to Star Wars Hologram!') - print(self.bot.message % f'Skin set to Star Wars Hologram.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Shortcut for equipping the skin CID_VIP_Athena_Commando_M_GalileoGondola_SG.", - help="Shortcut for equipping the skin CID_VIP_Athena_Commando_M_GalileoGondola_SG.\n" - "Example: !gift is a joke command." - ) - async def gift(self, ctx: fortnitepy.ext.commands.Context) -> None: - await self.bot.party.me.clear_emote() - - await self.bot.party.me.set_emote( - asset='EID_NeverGonna' - ) - - await ctx.send('What did you think would happen?') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Shortcut for equipping the emote EID_TourBus.", - help="Shortcut for equipping the emote EID_TourBus.\n" - "Example: !ponpon" - ) - async def ponpon(self, ctx: fortnitepy.ext.commands.Context) -> None: - await self.bot.party.me.set_emote( - asset='EID_TourBus' - ) - - await ctx.send('Emote set to Ninja Style!') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the enlightened value of a skin " - "(used for skins such as glitched Scratch or Golden Peely).", - help="Sets the enlightened value of a skin.\n" - "Example: !enlightened CID_701_Athena_Commando_M_BananaAgent 2 350" - ) - async def enlightened(self, ctx: fortnitepy.ext.commands.Context, cosmetic_id: str, br_season: int, - skin_level: int) -> None: - variant_types = { - 1: self.bot.party.me.create_variants(progressive=4), - 2: self.bot.party.me.create_variants(progressive=4), - 3: self.bot.party.me.create_variants(material=2) - } - - if 'cid' in cosmetic_id.lower(): - await self.bot.party.me.set_outfit( - asset=cosmetic_id, - variants=variant_types[br_season] if br_season in variant_types else variant_types[2], - enlightenment=(br_season, skin_level) - ) - - await ctx.send(f'Skin set to {cosmetic_id} at level {skin_level} (for Season 1{br_season}).') - elif 'bid' in cosmetic_id.lower(): - await self.bot.party.me.set_backpack( - asset=cosmetic_id, - variants=self.bot.party.me.create_variants(progressive=2), - enlightenment=(br_season, skin_level) - ) - await ctx.send(f'Backpack set to {cosmetic_id} at level {skin_level} (for Season 1{br_season}).') - - print( - self.bot.message % f'Enlightenment for {cosmetic_id} set to level {skin_level} ' - f'(for Season 1{br_season}).' - ) - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Shortcut for equipping the skin CID_605_Athena_Commando_M_TourBus.", - help="Shortcut for equipping the skin CID_605_Athena_Commando_M_TourBus.\n" - "Example: !ninja" - ) - async def ninja(self, ctx: fortnitepy.ext.commands.Context) -> None: - await self.bot.party.me.set_outfit( - asset='CID_605_Athena_Commando_M_TourBus' - ) - - await ctx.send('Skin set to Ninja!') - print(self.bot.message % f'Skin set to Ninja.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Equips all very rare skins.", - help="Equips all very rare skins.\n" - "Example: !rareskins" - ) - async def rareskins(self, ctx: fortnitepy.ext.commands.Context) -> None: - await ctx.send('Showing all rare skins now.') - - await self.bot.party.me.set_outfit( - asset='CID_030_Athena_Commando_M_Halloween', - variants=self.bot.party.me.create_variants(clothing_color=1) - ) - - await ctx.send('Skin set to Purple Skull Trooper!') - print(self.bot.message % f"Skin set to Purple Skull Trooper.") - await asyncio.sleep(2) - - await self.bot.party.me.set_outfit( - asset='CID_029_Athena_Commando_F_Halloween', - variants=self.bot.party.me.create_variants(material=3) - ) - - await ctx.send('Skin set to Pink Ghoul Trooper!') - print(self.bot.message % f"Skin set to Pink Ghoul Trooper.") - await asyncio.sleep(2) - - for rare_skin in ('CID_028_Athena_Commando_F', 'CID_017_Athena_Commando_M'): - await self.bot.party.me.set_outfit( - asset=rare_skin - ) - - await ctx.send(f'Skin set to {rare_skin}!') - print(self.bot.message % f"Skin set to: {rare_skin}!") - await asyncio.sleep(2) - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the outfit of the client to Golden Peely " - "(shortcut for !enlightened CID_701_Athena_Commando_M_BananaAgent 2 350).", - help="Sets the outfit of the client to Golden Peely.\n" - "Example: !goldenpeely" - ) - async def goldenpeely(self, ctx: fortnitepy.ext.commands.Context) -> None: - await self.bot.party.me.set_outfit( - asset='CID_701_Athena_Commando_M_BananaAgent', - variants=self.bot.party.me.create_variants(progressive=4), - enlightenment=(2, 350) - ) - - await ctx.send(f'Skin set to Golden Peely.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Randomly finds & equips a skin. Types currently include skin, backpack, emote & all. " - "If type is left blank, a random skin will be equipped.", - help="Randomly finds & equips a skin.\n" - "Example: !random skin" - ) - async def random(self, ctx: fortnitepy.ext.commands.Context, cosmetic_type: str = 'skin') -> None: - if cosmetic_type == 'skin': - all_outfits = await self.bot.fortnite_api.cosmetics.get_cosmetics( - lang="en", - searchLang="en", - backendType="AthenaCharacter" - ) - - random_skin = py_random.choice(all_outfits).id - - await self.bot.party.me.set_outfit( - asset=random_skin, - variants=self.bot.party.me.create_variants(profile_banner='ProfileBanner') - ) - - await ctx.send(f'Skin randomly set to {random_skin}.') - print(self.bot.message % f"Set skin randomly to: {random_skin}.") - - elif cosmetic_type == 'backpack': - all_backpacks = await self.bot.fortnite_api.cosmetics.get_cosmetics( - lang="en", - searchLang="en", - backendType="AthenaBackpack" - ) - - random_backpack = py_random.choice(all_backpacks).id - - await self.bot.party.me.set_backpack( - asset=random_backpack, - variants=self.bot.party.me.create_variants(profile_banner='ProfileBanner') - ) - - await ctx.send(f'Backpack randomly set to {random_backpack}.') - print(self.bot.message % f"Set backpack randomly to: {random_backpack}.") - - elif cosmetic_type == 'emote': - all_emotes = await self.bot.fortnite_api.cosmetics.get_cosmetics( - lang="en", - searchLang="en", - backendType="AthenaDance" - ) - - random_emote = py_random.choice(all_emotes).id - - await self.bot.party.me.set_emote( - asset=random_emote - ) - - await ctx.send(f'Emote randomly set to {random_emote}.') - print(self.bot.message % f"Set emote randomly to: {random_emote}.") - - elif cosmetic_type == 'all': - all_outfits = await self.bot.fortnite_api.cosmetics.get_cosmetics( - lang="en", - searchLang="en", - backendType="AthenaCharacter" - ) - - all_backpacks = await self.bot.fortnite_api.cosmetics.get_cosmetics( - lang="en", - searchLang="en", - backendType="AthenaBackpack" - ) - - all_emotes = await self.bot.fortnite_api.cosmetics.get_cosmetics( - lang="en", - searchLang="en", - backendType="AthenaDance" - ) - - random_outfit = py_random.choice(all_outfits).id - random_backpack = py_random.choice(all_backpacks).id - random_emote = py_random.choice(all_emotes).id - - await self.bot.party.me.set_outfit( - asset=random_outfit - ) - - await ctx.send(f'Skin randomly set to {random_outfit}.') - print(self.bot.message % f"Set skin randomly to: {random_outfit}.") - - await self.bot.party.me.set_backpack( - asset=random_backpack - ) - - await ctx.send(f'Backpack randomly set to {random_backpack}.') - print(self.bot.message % f"Set backpack randomly to: {random_backpack}.") - - await self.bot.party.me.set_emote( - asset=random_emote - ) - - await ctx.send(f'Emote randomly set to {random_emote}.') - print(self.bot.message % f"Set emote randomly to: {random_emote}.") - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Clears the currently set backpack.", - help="Clears the currently set backpack.\n" - "Example: !nobackpack" - ) - async def nobackpack(self, ctx: fortnitepy.ext.commands.Context) -> None: - await self.bot.party.me.clear_backpack() - await ctx.send('Removed backpack.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Clears the currently set pet.", - help="Clears the currently set pet.\n" - "Example: !nopet" - ) - async def nopet(self, ctx: fortnitepy.ext.commands.Context) -> None: - await self.bot.party.me.clear_pet() - await ctx.send('Removed pet.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Clears the currently set contrail.", - help="Clears the currently set contrail.\n" - "Example: !nocontrail" - ) - async def nocontrail(self, ctx: fortnitepy.ext.commands.Context) -> None: - await self.bot.party.me.clear_contrail() - await ctx.send('Removed contrail.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the outfit of the client using the outfits name with the ghost variant.", - help="Sets the outfit of the client using the outfits name with the ghost variant.\n" - "Example: !ghost Meowscles" - ) - async def ghost(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: - try: - skin_variants = self.bot.party.me.create_variants( - progressive=2 - ) - - cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( - lang="en", - searchLang="en", - matchMethod="contains", - name=content, - backendType="AthenaCharacter" - ) - - await self.bot.party.me.set_outfit( - asset=cosmetic.id, - variants=skin_variants - ) - - await ctx.send(f'Skin set to Ghost {cosmetic.name}!') - print(self.bot.message % f'Skin set to Ghost {cosmetic.name}.') - - except FortniteAPIAsync.exceptions.NotFound: - await ctx.send(f"Failed to find a skin with the name: {content}.") - print(self.bot.message % f"Failed to find a skin with the name: {content}.") - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the outfit of the client using the outfits name with the shadow variant.", - help="Sets the outfit of the client using the outfits name with the shadow variant.\n" - "Example: !shadow Midas" - ) - async def shadow(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: - try: - skin_variants = self.bot.party.me.create_variants( - progressive=3 - ) - - cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( - lang="en", - searchLang="en", - matchMethod="contains", - name=content, - backendType="AthenaCharacter" - ) - - await self.bot.party.me.set_outfit( - asset=cosmetic.id, - variants=skin_variants - ) - - await ctx.send(f'Skin set to Shadow {cosmetic.name}!') - print(self.bot.message % f'Skin set to Ghost {cosmetic.name}.') - - except FortniteAPIAsync.exceptions.NotFound: - await ctx.send(f"Failed to find a skin with the name: {content}.") - print(self.bot.message % f"Failed to find a skin with the name: {content}.") - - @commands.dm_only() - @commands.command( - name="set", - description="[Cosmetic] Equips all cosmetics from a set.", - help="Equips all cosmetics from a set.\n" - "Example: !set Fort Knights" - ) - async def _set(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: - cosmetic_types = { - "AthenaBackpack": self.bot.party.me.set_backpack, - "AthenaCharacter": self.bot.party.me.set_outfit, - "AthenaEmoji": self.bot.party.me.set_emoji, - "AthenaDance": self.bot.party.me.set_emote - } - - set_items = await self.bot.fortnite_api.cosmetics.get_cosmetics( - lang="en", - searchLang="en", - matchMethod="contains", - set=content - ) - - await ctx.send(f'Equipping all cosmetics from the {set_items[0].set["value"]} set.') - print(self.bot.message % f'Equipping all cosmetics from the {set_items[0].set["value"]} set.') - - for cosmetic in set_items: - if cosmetic.type['backendValue'] in cosmetic_types: - await cosmetic_types[cosmetic.type['backendValue']](asset=cosmetic.id) - - await ctx.send(f'{cosmetic.type["value"].capitalize()} set to {cosmetic.name}!') - print(self.bot.message % f'{cosmetic.type["value"].capitalize()} set to {cosmetic.name}.') - - await asyncio.sleep(3) - - await ctx.send(f'Finished equipping all cosmetics from the {set_items[0].set["value"]} set.') - print(self.bot.message % f'Fishing equipping all cosmetics from the {set_items[0].set["value"]} set.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Creates the variants list by the variants you set from skin name. " - "If you want to include spaces in the skin name, you need to enclose it in \"'s.", - help="Creates the variants list by the variants you set from skin name.\n" - "Example: !style \"Skull Trooper\" clothing_color 1" - ) - async def style(self, ctx: fortnitepy.ext.commands.Context, cosmetic_name: str, variant_type: str, - variant_int: str) -> None: - # cosmetic_types = { - # "AthenaCharacter": self.bot.party.me.set_outfit, - # "AthenaBackpack": self.bot.party.me.set_backpack, - # "AthenaPickaxe": self.bot.party.me.set_pickaxe - # } - - cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( - lang="en", - searchLang="en", - matchMethod="contains", - name=cosmetic_name, - backendType="AthenaCharacter" - ) - - cosmetic_variants = self.bot.party.me.create_variants( - # item=cosmetic.backend_type.value, - **{variant_type: int(variant_int) if variant_int.isdigit() else variant_int} - ) - - # await cosmetic_types[cosmetic.backend_type.value]( - await self.bot.party.me.set_outfit( - asset=cosmetic.id, - variants=cosmetic_variants - ) - - await ctx.send(f'Set variants of {cosmetic.id} to {variant_type} {variant_int}.') - print(self.bot.message % f'Set variants of {cosmetic.id} to {variant_type} {variant_int}.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Equips all new non encrypted cosmetics.", - help="Equips all new non encrypted cosmetics.\n" - "Example: !new" - ) - async def new(self, ctx: fortnitepy.ext.commands.Context, cosmetic_type: str = 'skins') -> None: - cosmetic_types = { - 'skins': { - 'id': 'AthenaCharacter', - 'function': self.bot.party.me.set_outfit - }, - 'backpacks': { - 'id': 'AthenaBackpack', - 'function': self.bot.party.me.set_backpack - }, - 'emotes': { - 'id': 'AthenaDance', - 'function': self.bot.party.me.set_emote - }, - } - - if cosmetic_type not in cosmetic_types: - return await ctx.send('Invalid cosmetic type, valid types include: skins, backpacks & emotes.') - - new_cosmetics = await self.bot.fortnite_api.cosmetics.get_new_cosmetics() - - for new_id in new_cosmetics: - print(new_id.type) - - for new_cosmetic in [new_id for new_id in new_cosmetics if - new_id.type['backendValue'] == cosmetic_types[cosmetic_type]['id']]: - await cosmetic_types[cosmetic_type]['function']( - asset=new_cosmetic.id - ) - - await ctx.send(f"{cosmetic_type[:-1].capitalize()} set to {new_cosmetic.id}.") - print(self.bot.message % f"{cosmetic_type[:-1].capitalize()} set to: {new_cosmetic.id}.") - - await asyncio.sleep(3) - - await ctx.send(f'Finished equipping all new unencrypted {cosmetic_type}.') - print(self.bot.message % f'Finished equipping all new unencrypted {cosmetic_type}.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Equips all skins currently in the item shop.", - help="Equips all skins currently in the item shop.\n" - "Example: !shop" - ) - async def shop(self, ctx: fortnitepy.ext.commands.Context) -> None: - return ctx.send('Command is broken due to the new shop catalogs, will replace soon with Fortnite-API.') - - store = await self.bot.fetch_item_shop() - - await ctx.send(f"Equipping all skins in today's item shop.") - print(self.bot.message % f"Equipping all skins in today's item shop.") - - for item in store.special_featured_items + \ - store.special_daily_items + \ - store.special_featured_items + \ - store.special_daily_items: - for grant in item.grants: - if grant['type'] == 'AthenaCharacter': - await self.bot.party.me.set_outfit( - asset=grant['asset'] - ) - - await ctx.send(f"Skin set to {item.display_names[0]}!") - print(self.bot.message % f"Skin set to: {item.display_names[0]}!") - - await asyncio.sleep(3) - - await ctx.send(f'Finished equipping all skins in the item shop.') - print(self.bot.message % f'Finished equipping all skins in the item shop.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Equips a random old default skin.", - help="Equips a random old default skin.\n" - "Example: !olddefault" - ) - async def olddefault(self, ctx: fortnitepy.ext.commands.Context) -> None: - random_default = py_random.choice( - [cid_ for cid_ in dir(fortnitepy.DefaultCharactersChapter1) if not cid_.startswith('_')] - ) - - await self.bot.party.me.set_outfit( - asset=random_default - ) - - await ctx.send(f'Skin set to {random_default}!') - print(self.bot.message % f"Skin set to {random_default}.") - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the outfit of the client to Hatless Recon Expert.", - help="Sets the outfit of the client to Hatless Recon Expert.\n" - "Example: !hatlessrecon" - ) - async def hatlessrecon(self, ctx: fortnitepy.ext.commands.Context) -> None: - skin_variants = self.bot.party.me.create_variants( - parts=2 - ) - - await self.bot.party.me.set_outfit( - asset='CID_022_Athena_Commando_F', - variants=skin_variants - ) - - await ctx.send('Skin set to Hatless Recon Expert!') - print(self.bot.message % f'Skin set to Hatless Recon Expert.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the outfit of the to the max tier skin in the defined season.", - help="Sets the outfit of the to the max tier skin in the defined season.\n" - "Example: !season 2" - ) - async def season(self, ctx: fortnitepy.ext.commands.Context, br_season: int) -> None: - max_tier_skins = { - 1: "CID_028_Athena_Commando_F", - 2: "CID_035_Athena_Commando_M_Medieval", - 3: "CID_084_Athena_Commando_M_Assassin", - 4: "CID_116_Athena_Commando_M_CarbideBlack", - 5: "CID_165_Athena_Commando_M_DarkViking", - 6: "CID_230_Athena_Commando_M_Werewolf", - 7: "CID_288_Athena_Commando_M_IceKing", - 8: "CID_352_Athena_Commando_F_Shiny", - 9: "CID_407_Athena_Commando_M_BattleSuit", - 10: "CID_484_Athena_Commando_M_KnightRemix", - 11: "CID_572_Athena_Commando_M_Viper", - 12: "CID_694_Athena_Commando_M_CatBurglar", - 13: "CID_767_Athena_Commando_F_BlackKnight", - 14: "CID_843_Athena_Commando_M_HightowerTomato_Casual", - 15: "CID_967_Athena_Commando_M_AncientGladiator", - 16: "CID_A_038_Athena_Commando_F_TowerSentinel", - 17: "CID_A_112_Athena_Commando_M_Ruckus" - } - - await self.bot.party.me.set_outfit(asset=max_tier_skins[br_season]) - - await ctx.send(f'Skin set to {max_tier_skins[br_season]}!') - print(self.bot.message % f"Skin set to {max_tier_skins[br_season]}.") - - @commands.dm_only() - @commands.command( - aliases=['henchmen'], - description="[Cosmetic] Sets the outfit of the client to a random Henchman skin.", - help="Sets the outfit of the client to a random Henchman skin.\n" - "Example: !henchman" - ) - async def henchman(self, ctx: fortnitepy.ext.commands.Context) -> None: - random_henchman = py_random.choice( - [ - "CID_794_Athena_Commando_M_HenchmanBadShorts_D", - "CID_NPC_Athena_Commando_F_HenchmanSpyDark", - "CID_791_Athena_Commando_M_HenchmanGoodShorts_D", - "CID_780_Athena_Commando_M_HenchmanBadShorts", - "CID_NPC_Athena_Commando_M_HenchmanGood", - "CID_692_Athena_Commando_M_HenchmanTough", - "CID_707_Athena_Commando_M_HenchmanGood", - "CID_792_Athena_Commando_M_HenchmanBadShorts_B", - "CID_793_Athena_Commando_M_HenchmanBadShorts_C", - "CID_NPC_Athena_Commando_M_HenchmanBad", - "CID_790_Athena_Commando_M_HenchmanGoodShorts_C", - "CID_779_Athena_Commando_M_HenchmanGoodShorts", - "CID_NPC_Athena_Commando_F_RebirthDefault_Henchman", - "CID_NPC_Athena_Commando_F_HenchmanSpyGood", - "CID_706_Athena_Commando_M_HenchmanBad", - "CID_789_Athena_Commando_M_HenchmanGoodShorts_B" - ] - ) - - await self.bot.party.me.set_outfit( - asset=random_henchman - ) - - await ctx.send(f'Skin set to {random_henchman}!') - print(self.bot.message % f"Skin set to {random_henchman}.") - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the emote of the client to Floss.", - help="Sets the emote of the client to Floss.\n" - "Example: !floss" - ) - async def floss(self, ctx: fortnitepy.ext.commands.Context) -> None: - # // You caused this FunGames, you caused this... - await self.bot.party.me.set_emote( - asset='EID_Floss' - ) - - await ctx.send('Emote set to Floss!') - print(self.bot.message % f"Emote set to Floss.") - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the outfit of the client to a random marauder skin.", - help="Sets the outfit of the client to a random marauder skin.\n" - "Example: !marauder" - ) - async def marauder(self, ctx: fortnitepy.ext.commands.Context) -> None: - random_marauder = py_random.choice( - [ - "CID_NPC_Athena_Commando_M_MarauderHeavy", - "CID_NPC_Athena_Commando_M_MarauderElite", - "CID_NPC_Athena_Commando_M_MarauderGrunt" - ] - ) - - await self.bot.party.me.set_outfit( - asset=random_marauder - ) - - await ctx.send(f'Skin set to {random_marauder}!') - print(self.bot.message % f"Skin set to {random_marauder}.") - - @commands.dm_only() - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the outfit of the client to Golden Brutus " - "(shortcut for !enlightened CID_692_Athena_Commando_M_HenchmanTough 2 180).", - help="Sets the outfit of the client to Golden Brutus.\n" - "Example: !goldenbrutus" - ) - async def goldenbrutus(self, ctx: fortnitepy.ext.commands.Context) -> None: - await self.bot.party.me.set_outfit( - asset='CID_692_Athena_Commando_M_HenchmanTough', - variants=self.bot.party.me.create_variants(progressive=4), - enlightenment=(2, 180) - ) - - await ctx.send(f'Skin set to Golden Brutus.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the outfit of the client to Golden Meowscles " - "(shortcut for !enlightened CID_693_Athena_Commando_M_BuffCat 2 220).", - help="Sets the outfit of the client to Golden Meowscles.\n" - "Example: !goldenmeowscles" - ) - async def goldenmeowscles(self, ctx: fortnitepy.ext.commands.Context) -> None: - await self.bot.party.me.set_outfit( - asset='CID_693_Athena_Commando_M_BuffCat', - variants=self.bot.party.me.create_variants(progressive=4), - enlightenment=(2, 220) - ) - - await ctx.send(f'Skin set to Golden Meowscles.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the outfit of the client to Golden Midas " - "(shortcut for !enlightened CID_694_Athena_Commando_M_CatBurglar 2 140).", - help="Sets the outfit of the client to Golden Peely.\n" - "Example: !goldenmidas" - ) - async def goldenmidas(self, ctx: fortnitepy.ext.commands.Context) -> None: - await self.bot.party.me.set_outfit( - asset='CID_694_Athena_Commando_M_CatBurglar', - variants=self.bot.party.me.create_variants(progressive=4), - enlightenment=(2, 140) - ) - - await ctx.send(f'Skin set to Golden Midas.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the outfit of the client to Golden Skye " - "(shortcut for !enlightened CID_690_Athena_Commando_F_Photographer 2 300).", - help="Sets the outfit of the client to Golden Skye.\n" - "Example: !goldenskye" - ) - async def goldenskye(self, ctx: fortnitepy.ext.commands.Context) -> None: - await self.bot.party.me.set_outfit( - asset='CID_690_Athena_Commando_F_Photographer', - variants=self.bot.party.me.create_variants(progressive=4), - enlightenment=(2, 300) - ) - - await ctx.send(f'Skin set to Golden Skye.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Sets the outfit of the client to Golden TNTina " - "(shortcut for !enlightened CID_691_Athena_Commando_F_TNTina 2 350).", - help="Sets the outfit of the client to Golden TNTina.\n" - "Example: !goldentntina" - ) - async def goldentntina(self, ctx: fortnitepy.ext.commands.Context) -> None: - await self.bot.party.me.set_outfit( - asset='CID_691_Athena_Commando_F_TNTina', - variants=self.bot.party.me.create_variants(progressive=7), - enlightenment=(2, 260) - ) - - await ctx.send(f'Skin set to Golden TNTina.') - - @commands.dm_only() - @commands.command( - description="[Cosmetic] Equips a To-Be-Determined outfit.", - help="Equips a To-Be-Determined outfit.\n" - "Example: !tbd 2" - ) - async def tbd(self, ctx: fortnitepy.ext.commands.Context, skin: int = 1) -> None: - cosmetics = await self.bot.fortnite_api.cosmetics.get_cosmetics( - lang="en", - searchLang="en", - matchMethod="full", - name="TBD", - backendType="AthenaCharacter" - ) - - if not skin or skin > len(cosmetics): - return await ctx.send(f'Invalid skin number, there is only {len(cosmetics)} TBD outfits.') - - await ctx.send(f'Found {len(cosmetics)} TBD outfits.') - - await self.bot.party.me.set_outfit(asset=cosmetics[skin - 1].id) - - await ctx.send(f'Skin set to {cosmetics[skin - 1].id}\nUse !tbd <1 to {len(cosmetics)}> to equip another.') +""" +“Commons Clause” License Condition v1.0 +Copyright Oli 2019-2023 + +The Software is provided to you by the Licensor under the +License, as defined below, subject to the following condition. + +Without limiting other conditions in the License, the grant +of rights under the License will not include, and the License +does not grant to you, the right to Sell the Software. + +For purposes of the foregoing, “Sell” means practicing any or +all of the rights granted to you under the License to provide +to third parties, for a fee or other consideration (including +without limitation fees for hosting or consulting/ support +services related to the Software), a product or service whose +value derives, entirely or substantially, from the functionality +of the Software. Any license notice or attribution required by +the License must also include this Commons Clause License +Condition notice. + +Software: PartyBot (fortnitepy-bot) + +License: Apache 2.0 +""" + +# System imports. +import asyncio +import functools + +from typing import Optional, Union, Tuple + +# Third party imports. +import fortnitepy +import aiohttp +import FortniteAPIAsync +import random as py_random + +from fortnitepy.ext import commands + + +class CosmeticCommands(commands.Cog): + def __init__(self, bot: commands.Bot) -> None: + self.bot = bot + + # async def set_vtid(self, variant_token: str) -> Tuple[str, str, int]: + # async with aiohttp.ClientSession() as session: + # request = await session.request( + # method='GET', + # url='https://benbot.app/api/v1/assetProperties', + # params={ + # 'path': 'FortniteGame/Content/Athena/' + # f'Items/CosmeticVariantTokens/{variant_token}.uasset' + # }) + # + # response = await request.json() + # + # file_location = response['export_properties'][0] + # + # skin_cid = file_location['cosmetic_item'] + # variant_channel_tag = file_location['VariantChanelTag']['TagName'] + # variant_name_tag = file_location['VariantNameTag']['TagName'] + # + # variant_type = variant_channel_tag.split( + # 'Cosmetics.Variant.Channel.' + # )[1].split('.')[0] + # + # variant_int = int("".join(filter( + # lambda x: x.isnumeric(), variant_name_tag + # ))) + # + # return skin_cid, variant_type if variant_type != 'ClothingColor' else 'clothing_color', variant_int + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the outfit of the client using the outfits name.", + help="Sets the outfit of the client using the outfits name.\n" + "Example: !skin Nog Ops" + ) + async def skin(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + try: + cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( + matchMethod="contains", + name=content, + backendType="AthenaCharacter" + ) + except FortniteAPIAsync.exceptions.NotFound: + print(self.bot.message % f"Failed to find a skin with the name: {content}.") + return await ctx.send(f"Failed to find a skin with the name: {content}.") + + if "brcosmetics" in cosmetic.path.lower(): + path = f"AthenaCharacterItemDefinition'/BRCosmetics/Athena/Items/Cosmetics/Characters/{cosmetic.id}.{cosmetic.id}'" + await self.bot.party.me.set_outfit(asset=path) + else: + await self.bot.party.me.set_outfit(asset=cosmetic.id) + + await ctx.send(f'Skin set to {cosmetic.id}.') + print(self.bot.message % f"Set skin to: {cosmetic.id}.") + + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the backpack of the client using the backpacks name.", + help="Sets the backpack of the client using the backpacks name.\n" + "Example: !backpack Black Shield" + ) + async def backpack(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + try: + cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( + matchMethod="contains", + name=content, + backendType="AthenaBackpack" + ) + except FortniteAPIAsync.exceptions.NotFound: + await ctx.send(f"Failed to find a backpack with the name: {content}.") + print(self.bot.message % f"Failed to find a backpack with the name: {content}.") + + if "brcosmetics" in cosmetic.path.lower(): + path = f"AthenaCharacterItemDefinition'/BRCosmetics/Athena/Items/Cosmetics/Backpacks/{cosmetic.id}.{cosmetic.id}'" + await self.bot.party.me.set_backpack(asset=path) + else: + await self.bot.party.me.set_outfit(asset=cosmetic.id) + + await ctx.send(f'Backpack set to {cosmetic.id}.') + print(self.bot.message % f"Set backpack to: {cosmetic.id}.") + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the emote of the client using the emotes name.", + help="Sets the emote of the client using the emotes name.\n" + "Example: !emote Windmill Floss" + ) + async def emote(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + try: + cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( + matchMethod="contains", + name=content, + backendType="AthenaDance" + ) + except FortniteAPIAsync.exceptions.NotFound: + await ctx.send(f"Failed to find an emote with the name: {content}.") + print(self.bot.message % f"Failed to find an emote with the name: {content}.") + + if "brcosmetics" in cosmetic.path.lower(): + path = f"AthenaCharacterItemDefinition'/BRCosmetics/Athena/Items/Cosmetics/Dances/{cosmetic.id}.{cosmetic.id}'" + await self.bot.party.me.clear_emote() + await self.bot.party.me.set_emote(asset=path) + else: + await self.bot.party.me.clear_emote() + await self.bot.party.me.set_emote(asset=cosmetic.id) + + await ctx.send(f'Emote set to {cosmetic.id}.') + print(self.bot.message % f"Set emote to: {cosmetic.id}.") + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the pickaxe of the client using the pickaxe name.", + help="Sets the pickaxe of the client using the pickaxe name.\n" + "Example: !pickaxe Raider's Revenge" + ) + async def pickaxe(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + try: + cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( + lang="en", + searchLang="en", + matchMethod="contains", + name=content, + backendType="AthenaPickaxe" + ) + + await ctx.send(f'Pickaxe set to {cosmetic.id}.') + print(self.bot.message % f"Set pickaxe to: {cosmetic.id}.") + await self.bot.party.me.set_pickaxe(asset=cosmetic.id) + + except FortniteAPIAsync.exceptions.NotFound: + await ctx.send(f"Failed to find a pickaxe with the name: {content}.") + print(self.bot.message % f"Failed to find a pickaxe with the name: {content}.") + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the pet (backpack) of the client using the pets name.", + help="Sets the pet (backpack) of the client using the pets name.\n" + "Example: !pet Bonesy" + ) + async def pet(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + try: + cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( + lang="en", + searchLang="en", + matchMethod="contains", + name=content, + backendType="AthenaPetCarrier" + ) + + await ctx.send(f'Pet set to {cosmetic.id}.') + print(self.bot.message % f"Set pet to: {cosmetic.id}.") + await self.bot.party.me.set_pet(asset=cosmetic.id) + + except FortniteAPIAsync.exceptions.NotFound: + await ctx.send(f"Failed to find a pet with the name: {content}.") + print(self.bot.message % f"Failed to find a pet with the name: {content}.") + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the emoji of the client using the emojis name.", + help="Sets the emoji of the client using the emojis name.\n" + "Example: !emoji Snowball" + ) + async def emoji(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + try: + cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( + lang="en", + searchLang="en", + matchMethod="contains", + name=content, + backendType="AthenaEmoji" + ) + + await ctx.send(f'Emoji set to {cosmetic.id}.') + print(self.bot.message % f"Set emoji to: {cosmetic.id}.") + await self.bot.party.me.set_emoji(asset=cosmetic.id) + + except FortniteAPIAsync.exceptions.NotFound: + await ctx.send(f"Failed to find an emoji with the name: {content}.") + print(self.bot.message % f"Failed to find an emoji with the name: {content}.") + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the contrail of the client using the contrail name.", + help="Sets the contrail of the client using the contrail name.\n" + "Example: !contrail Holly And Divey" + ) + async def contrail(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + try: + cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( + lang="en", + searchLang="en", + matchMethod="contains", + name=content, + backendType="AthenaSkyDiveContrail" + ) + + await ctx.send(f'Contrail set to {cosmetic.id}.') + print(self.bot.message % f"Set contrail to: {cosmetic.id}.") + await self.bot.party.me.set_contrail(asset=cosmetic.id) + + except FortniteAPIAsync.exceptions.NotFound: + await ctx.send(f"Failed to find a contrail with the name: {content}.") + print(self.bot.message % f"Failed to find an contrail with the name: {content}.") + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the outfit of the client to Purple Skull Trooper.", + help="Sets the outfit of the client to Purple Skull Trooper.\n" + "Example: !purpleskull" + ) + async def purpleskull(self, ctx: fortnitepy.ext.commands.Context) -> None: + skin_variants = self.bot.party.me.create_variants( + clothing_color=1 + ) + + await self.bot.party.me.set_outfit( + asset='CID_030_Athena_Commando_M_Halloween', + variants=skin_variants + ) + + await ctx.send('Skin set to Purple Skull Trooper!') + print(self.bot.message % f"Skin set to Purple Skull Trooper.") + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the outfit of the client to Pink Ghoul Trooper.", + help="Sets the outfit of the client to Pink Ghoul Trooper.\n" + "Example: !pinkghoul" + ) + async def pinkghoul(self, ctx: fortnitepy.ext.commands.Context) -> None: + skin_variants = self.bot.party.me.create_variants( + material=3 + ) + + await self.bot.party.me.set_outfit( + asset='CID_029_Athena_Commando_F_Halloween', + variants=skin_variants + ) + + await ctx.send('Skin set to Pink Ghoul Trooper!') + print(self.bot.message % f"Skin set to Pink Ghoul Trooper.") + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the backpack of the client to Purple Ghost Portal.", + help="Sets the backpack of the client to Purple Ghost Portal.\n" + "Example: !purpleportal" + ) + async def purpleportal(self, ctx: fortnitepy.ext.commands.Context) -> None: + skin_variants = self.bot.party.me.create_variants( + config_overrides={ + 'particle': 'Particle{}' + }, + particle=1 + ) + + await self.bot.party.me.set_backpack( + asset='BID_105_GhostPortal', + variants=skin_variants + ) + + await ctx.send('Backpack set to Purple Ghost Portal!') + print(self.bot.message % f"Backpack set to Purple Ghost Portal.") + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the outfit of the client using CID.", + help="Sets the outfit of the client using CID.\n" + "Example: !cid CID_047_Athena_Commando_F_HolidayReindeer" + ) + async def cid(self, ctx: fortnitepy.ext.commands.Context, character_id: str) -> None: + await self.bot.party.me.set_outfit( + asset=character_id, + variants=self.bot.party.me.create_variants(profile_banner='ProfileBanner') + ) + + await ctx.send(f'Skin set to {character_id}.') + print(self.bot.message % f'Skin set to {character_id}.') + + # NOTE: Command is currently not possible due to no APIs allowing you to browse the files, hope to fix eventually. + # @commands.dm_only() + # @commands.command( + # description="[Cosmetic] Creates the variants list by the variants you set using VTID.", + # help="Creates the variants list by the variants you set using VTID.\n" + # "Example: !vtid VTID_052_Skull_Trooper_RedFlames" + # ) + # async def vtid(self, ctx: fortnitepy.ext.commands.Context, variant_token: str) -> None: + # variant_id = await self.set_vtid(variant_token) + # + # if variant_id[1].lower() == 'particle': + # skin_variants = self.bot.party.me.create_variants(config_overrides={'particle': 'Particle{}'}, particle=1) + # else: + # skin_variants = self.bot.party.me.create_variants(**{variant_id[1].lower(): int(variant_id[2])}) + # + # await self.bot.party.me.set_outfit(asset=variant_id[0], variants=skin_variants) + # print(self.bot.message % f'Set variants of {variant_id[0]} to {variant_id[1]} {variant_id[2]}.') + # await ctx.send(f'Variants set to {variant_token}.\n' + # '(Warning: This feature is not supported, please use !variants)') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Creates the variants list by the variants you set.", + help="Creates the variants list by the variants you set.\n" + "Example: !variants CID_030_Athena_Commando_M_Halloween clothing_color 1" + ) + async def variants(self, ctx: fortnitepy.ext.commands.Context, cosmetic_id: str, variant_type: str, + variant_int: str) -> None: + if 'cid' in cosmetic_id.lower() and 'jersey_color' not in variant_type.lower(): + skin_variants = self.bot.party.me.create_variants( + **{variant_type: int(variant_int) if variant_int.isdigit() else variant_int} + ) + + await self.bot.party.me.set_outfit( + asset=cosmetic_id, + variants=skin_variants + ) + + elif 'cid' in cosmetic_id.lower() and 'jersey_color' in variant_type.lower(): + cosmetic_variants = self.bot.party.me.create_variants( + pattern=0, + numeric=69, + **{variant_type: int(variant_int) if variant_int.isdigit() else variant_int} + ) + + await self.bot.party.me.set_outfit( + asset=cosmetic_id, + variants=cosmetic_variants + ) + + elif 'bid' in cosmetic_id.lower(): + cosmetic_variants = self.bot.party.me.create_variants( + **{variant_type: int(variant_int) if variant_int.isdigit() else variant_int} + ) + + await self.bot.party.me.set_backpack( + asset=cosmetic_id, + variants=cosmetic_variants + ) + elif 'pickaxe_id' in cosmetic_id.lower(): + cosmetic_variants = self.bot.party.me.create_variants( + **{variant_type: int(variant_int) if variant_int.isdigit() else variant_int} + ) + + await self.bot.party.me.set_pickaxe( + asset=cosmetic_id, + variants=cosmetic_variants + ) + + await ctx.send(f'Set variants of {cosmetic_id} to {variant_type} {variant_int}.') + print(self.bot.message % f'Set variants of {cosmetic_id} to {variant_type} {variant_int}.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the outfit of the client to Checkered Renegade.", + help="Sets the outfit of the client to Checkered Renegade.\n" + "Example: !checkeredrenegade" + ) + async def checkeredrenegade(self, ctx: fortnitepy.ext.commands.Context) -> None: + skin_variants = self.bot.party.me.create_variants( + material=2 + ) + + await self.bot.party.me.set_outfit( + asset='CID_028_Athena_Commando_F', + variants=skin_variants + ) + + await ctx.send('Skin set to Checkered Renegade!') + print(self.bot.message % f'Skin set to Checkered Renegade.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the outfit of the client to Minty Elf.", + help="Sets the outfit of the client to Minty Elf.\n" + "Example: !mintyelf" + ) + async def mintyelf(self, ctx: fortnitepy.ext.commands.Context) -> None: + skin_variants = self.bot.party.me.create_variants( + material=2 + ) + + await self.bot.party.me.set_outfit( + asset='CID_051_Athena_Commando_M_HolidayElf', + variants=skin_variants + ) + + await ctx.send('Skin set to Minty Elf!') + print(self.bot.message % f'Skin set to Minty Elf.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the emote of the client using EID.", + help="Sets the emote of the client using EID.\n" + "Example: !eid EID_Floss" + ) + async def eid(self, ctx: fortnitepy.ext.commands.Context, emote_id: str) -> None: + await self.bot.party.me.clear_emote() + await self.bot.party.me.set_emote( + asset=emote_id + ) + + await ctx.send(f'Emote set to {emote_id}!') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Clears/stops the emote currently playing.", + help="Clears/stops the emote currently playing.\n" + "Example: !stop" + ) + async def stop(self, ctx: fortnitepy.ext.commands.Context) -> None: + await self.bot.party.me.clear_emote() + await ctx.send('Stopped emoting.') + print(self.bot.message % f'Stopped emoting.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the backpack of the client using BID.", + help="Sets the backpack of the client using BID.\n" + "Example: !bid BID_023_Pinkbear" + ) + async def bid(self, ctx: fortnitepy.ext.commands.Context, backpack_id: str) -> None: + await self.bot.party.me.set_backpack( + asset=backpack_id + ) + + await ctx.send(f'Backbling set to {backpack_id}!') + print(self.bot.message % f'Backbling set to {backpack_id}!') + + @commands.dm_only() + @commands.command( + aliases=['legacypickaxe'], + description="[Cosmetic] Sets the pickaxe of the client using PICKAXE_ID", + help="Sets the pickaxe of the client using PICKAXE_ID\n" + "Example: !pickaxe_id Pickaxe_ID_073_Balloon" + ) + async def pickaxe_id(self, ctx: fortnitepy.ext.commands.Context, pickaxe_id_: str) -> None: + await self.bot.party.me.set_pickaxe( + asset=pickaxe_id_ + ) + + await ctx.send(f'Pickaxe set to {pickaxe_id_}') + print(self.bot.message % f'Pickaxe set to {pickaxe_id_}') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the pet of the client using PetCarrier_.", + help="Sets the pet of the client using PetCarrier_.\n" + "Example: !pet_carrier PetCarrier_002_Chameleon" + ) + async def pet_carrier(self, ctx: fortnitepy.ext.commands.Context, pet_carrier_id: str) -> None: + await self.bot.party.me.set_pet( + asset=pet_carrier_id + ) + + await ctx.send(f'Pet set to {pet_carrier_id}!') + print(self.bot.message % f'Pet set to {pet_carrier_id}!') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the emoji of the client using Emoji_.", + help="Sets the emoji of the client using Emoji_.\n" + "Example: !emoji_id Emoji_PeaceSign" + ) + async def emoji_id(self, ctx: fortnitepy.ext.commands.Context, emoji_: str) -> None: + await self.bot.party.me.clear_emote() + await self.bot.party.me.set_emoji( + asset=emoji_ + ) + + await ctx.send(f'Emoji set to {emoji_}!') + print(self.bot.message % f'Emoji set to {emoji_}!') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the contrail of the client using Trails_.", + help="Sets the contrail of the client using Trails_.\n" + "Example: !trails Trails_ID_075_Celestial" + ) + async def trails(self, ctx: fortnitepy.ext.commands.Context, trails_: str) -> None: + await self.bot.party.me.set_contrail( + asset=trails_ + ) + + await ctx.send(f'Contrail set to {trails}!') + print(self.bot.message % f'Contrail set to {trails}!') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets pickaxe using PICKAXE_ID or display name & does 'Point it Out'. If no pickaxe is " + "specified, only the emote will be played.", + help="Sets pickaxe using PICKAXE_ID or display name & does 'Point it Out'. If no pickaxe is " + "specified, only the emote will be played.\n" + "Example: !point Pickaxe_ID_029_Assassin" + ) + async def point(self, ctx: fortnitepy.ext.commands.Context, *, content: Optional[str] = None) -> None: + if content is None: + await self.bot.party.me.set_emote(asset='EID_None') + await self.bot.party.me.set_emote(asset='EID_IceKing') + await ctx.send(f'Point it Out played.') + elif 'pickaxe_id' in content.lower(): + await self.bot.party.me.set_pickaxe(asset=content) + await self.bot.party.me.set_emote(asset='EID_None') + await self.bot.party.me.set_emote(asset='EID_IceKing') + await ctx.send(f'Pickaxe set to {content} & Point it Out played.') + else: + try: + cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( + lang="en", + searchLang="en", + matchMethod="contains", + name=content, + backendType="AthenaPickaxe" + ) + + await self.bot.party.me.set_pickaxe(asset=cosmetic.id) + await self.bot.party.me.set_emote(asset='EID_None') + await self.bot.party.me.set_emote(asset='EID_IceKing') + await ctx.send(f'Pickaxe set to {content} & Point it Out played.') + except FortniteAPIAsync.exceptions.NotFound: + await ctx.send(f"Failed to find a pickaxe with the name: {content}") + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Copies the cosmetic loadout of the defined user. If user is left blank, " + "the message author will be used.", + help="Copies the cosmetic loadout of the defined user. If user is left blank, " + "the message author will be used.\n" + "Example: !copy Terbau" + ) + async def copy(self, ctx: fortnitepy.ext.commands.Context, *, epic_username: Optional[str] = None) -> None: + if epic_username is None: + member = [m for m in self.bot.party.members if m.id == ctx.author.id][0] + else: + user = await self.bot.fetch_user(epic_username) + member = [m for m in self.bot.party.members if m.id == user.id][0] + + await self.bot.party.me.edit( + functools.partial( + fortnitepy.ClientPartyMember.set_outfit, + asset=member.outfit, + variants=member.outfit_variants + ), + functools.partial( + fortnitepy.ClientPartyMember.set_backpack, + asset=member.backpack, + variants=member.backpack_variants + ), + functools.partial( + fortnitepy.ClientPartyMember.set_pickaxe, + asset=member.pickaxe, + variants=member.pickaxe_variants + ), + functools.partial( + fortnitepy.ClientPartyMember.set_banner, + icon=member.banner[0], + color=member.banner[1], + season_level=member.banner[2] + ), + functools.partial( + fortnitepy.ClientPartyMember.set_battlepass_info, + has_purchased=True, + level=member.battlepass_info[1] + ) + ) + + if member.emote is not None: + await self.bot.party.me.set_emote(asset=member.emote) + + await ctx.send(f'Copied the loadout of {member.display_name}.') + print(self.bot.message % f'Copied the loadout of {member.display_name}.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Shortcut for equipping the skin CID_VIP_Athena_Commando_M_GalileoGondola_SG.", + help="Shortcut for equipping the skin CID_VIP_Athena_Commando_M_GalileoGondola_SG.\n" + "Example: !hologram" + ) + async def hologram(self, ctx: fortnitepy.ext.commands.Context) -> None: + await self.bot.party.me.set_outfit( + asset='CID_VIP_Athena_Commando_M_GalileoGondola_SG' + ) + + await ctx.send('Skin set to Star Wars Hologram!') + print(self.bot.message % f'Skin set to Star Wars Hologram.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Shortcut for equipping the skin CID_VIP_Athena_Commando_M_GalileoGondola_SG.", + help="Shortcut for equipping the skin CID_VIP_Athena_Commando_M_GalileoGondola_SG.\n" + "Example: !gift is a joke command." + ) + async def gift(self, ctx: fortnitepy.ext.commands.Context) -> None: + await self.bot.party.me.clear_emote() + + await self.bot.party.me.set_emote( + asset='EID_NeverGonna' + ) + + await ctx.send('What did you think would happen?') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Shortcut for equipping the emote EID_TourBus.", + help="Shortcut for equipping the emote EID_TourBus.\n" + "Example: !ponpon" + ) + async def ponpon(self, ctx: fortnitepy.ext.commands.Context) -> None: + await self.bot.party.me.set_emote( + asset='EID_TourBus' + ) + + await ctx.send('Emote set to Ninja Style!') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the enlightened value of a skin " + "(used for skins such as glitched Scratch or Golden Peely).", + help="Sets the enlightened value of a skin.\n" + "Example: !enlightened CID_701_Athena_Commando_M_BananaAgent 2 350" + ) + async def enlightened(self, ctx: fortnitepy.ext.commands.Context, cosmetic_id: str, br_season: int, + skin_level: int) -> None: + variant_types = { + 1: self.bot.party.me.create_variants(progressive=4), + 2: self.bot.party.me.create_variants(progressive=4), + 3: self.bot.party.me.create_variants(material=2) + } + + if 'cid' in cosmetic_id.lower(): + await self.bot.party.me.set_outfit( + asset=cosmetic_id, + variants=variant_types[br_season] if br_season in variant_types else variant_types[2], + enlightenment=(br_season, skin_level) + ) + + await ctx.send(f'Skin set to {cosmetic_id} at level {skin_level} (for Season 1{br_season}).') + elif 'bid' in cosmetic_id.lower(): + await self.bot.party.me.set_backpack( + asset=cosmetic_id, + variants=self.bot.party.me.create_variants(progressive=2), + enlightenment=(br_season, skin_level) + ) + await ctx.send(f'Backpack set to {cosmetic_id} at level {skin_level} (for Season 1{br_season}).') + + print( + self.bot.message % f'Enlightenment for {cosmetic_id} set to level {skin_level} ' + f'(for Season 1{br_season}).' + ) + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Shortcut for equipping the skin CID_605_Athena_Commando_M_TourBus.", + help="Shortcut for equipping the skin CID_605_Athena_Commando_M_TourBus.\n" + "Example: !ninja" + ) + async def ninja(self, ctx: fortnitepy.ext.commands.Context) -> None: + await self.bot.party.me.set_outfit( + asset='CID_605_Athena_Commando_M_TourBus' + ) + + await ctx.send('Skin set to Ninja!') + print(self.bot.message % f'Skin set to Ninja.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Equips all very rare skins.", + help="Equips all very rare skins.\n" + "Example: !rareskins" + ) + async def rareskins(self, ctx: fortnitepy.ext.commands.Context) -> None: + await ctx.send('Showing all rare skins now.') + + await self.bot.party.me.set_outfit( + asset='CID_030_Athena_Commando_M_Halloween', + variants=self.bot.party.me.create_variants(clothing_color=1) + ) + + await ctx.send('Skin set to Purple Skull Trooper!') + print(self.bot.message % f"Skin set to Purple Skull Trooper.") + await asyncio.sleep(2) + + await self.bot.party.me.set_outfit( + asset='CID_029_Athena_Commando_F_Halloween', + variants=self.bot.party.me.create_variants(material=3) + ) + + await ctx.send('Skin set to Pink Ghoul Trooper!') + print(self.bot.message % f"Skin set to Pink Ghoul Trooper.") + await asyncio.sleep(2) + + for rare_skin in ('CID_028_Athena_Commando_F', 'CID_017_Athena_Commando_M'): + await self.bot.party.me.set_outfit( + asset=rare_skin + ) + + await ctx.send(f'Skin set to {rare_skin}!') + print(self.bot.message % f"Skin set to: {rare_skin}!") + await asyncio.sleep(2) + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the outfit of the client to Golden Peely " + "(shortcut for !enlightened CID_701_Athena_Commando_M_BananaAgent 2 350).", + help="Sets the outfit of the client to Golden Peely.\n" + "Example: !goldenpeely" + ) + async def goldenpeely(self, ctx: fortnitepy.ext.commands.Context) -> None: + await self.bot.party.me.set_outfit( + asset='CID_701_Athena_Commando_M_BananaAgent', + variants=self.bot.party.me.create_variants(progressive=4), + enlightenment=(2, 350) + ) + + await ctx.send(f'Skin set to Golden Peely.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Randomly finds & equips a skin. Types currently include skin, backpack, emote & all. " + "If type is left blank, a random skin will be equipped.", + help="Randomly finds & equips a skin.\n" + "Example: !random skin" + ) + async def random(self, ctx: fortnitepy.ext.commands.Context, cosmetic_type: str = 'skin') -> None: + if cosmetic_type == 'skin': + all_outfits = await self.bot.fortnite_api.cosmetics.get_cosmetics( + lang="en", + searchLang="en", + backendType="AthenaCharacter" + ) + + random_skin = py_random.choice(all_outfits).id + + await self.bot.party.me.set_outfit( + asset=random_skin, + variants=self.bot.party.me.create_variants(profile_banner='ProfileBanner') + ) + + await ctx.send(f'Skin randomly set to {random_skin}.') + print(self.bot.message % f"Set skin randomly to: {random_skin}.") + + elif cosmetic_type == 'backpack': + all_backpacks = await self.bot.fortnite_api.cosmetics.get_cosmetics( + lang="en", + searchLang="en", + backendType="AthenaBackpack" + ) + + random_backpack = py_random.choice(all_backpacks).id + + await self.bot.party.me.set_backpack( + asset=random_backpack, + variants=self.bot.party.me.create_variants(profile_banner='ProfileBanner') + ) + + await ctx.send(f'Backpack randomly set to {random_backpack}.') + print(self.bot.message % f"Set backpack randomly to: {random_backpack}.") + + elif cosmetic_type == 'emote': + all_emotes = await self.bot.fortnite_api.cosmetics.get_cosmetics( + lang="en", + searchLang="en", + backendType="AthenaDance" + ) + + random_emote = py_random.choice(all_emotes).id + + await self.bot.party.me.set_emote( + asset=random_emote + ) + + await ctx.send(f'Emote randomly set to {random_emote}.') + print(self.bot.message % f"Set emote randomly to: {random_emote}.") + + elif cosmetic_type == 'all': + all_outfits = await self.bot.fortnite_api.cosmetics.get_cosmetics( + lang="en", + searchLang="en", + backendType="AthenaCharacter" + ) + + all_backpacks = await self.bot.fortnite_api.cosmetics.get_cosmetics( + lang="en", + searchLang="en", + backendType="AthenaBackpack" + ) + + all_emotes = await self.bot.fortnite_api.cosmetics.get_cosmetics( + lang="en", + searchLang="en", + backendType="AthenaDance" + ) + + random_outfit = py_random.choice(all_outfits).id + random_backpack = py_random.choice(all_backpacks).id + random_emote = py_random.choice(all_emotes).id + + await self.bot.party.me.set_outfit( + asset=random_outfit + ) + + await ctx.send(f'Skin randomly set to {random_outfit}.') + print(self.bot.message % f"Set skin randomly to: {random_outfit}.") + + await self.bot.party.me.set_backpack( + asset=random_backpack + ) + + await ctx.send(f'Backpack randomly set to {random_backpack}.') + print(self.bot.message % f"Set backpack randomly to: {random_backpack}.") + + await self.bot.party.me.set_emote( + asset=random_emote + ) + + await ctx.send(f'Emote randomly set to {random_emote}.') + print(self.bot.message % f"Set emote randomly to: {random_emote}.") + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Clears the currently set backpack.", + help="Clears the currently set backpack.\n" + "Example: !nobackpack" + ) + async def nobackpack(self, ctx: fortnitepy.ext.commands.Context) -> None: + await self.bot.party.me.clear_backpack() + await ctx.send('Removed backpack.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Clears the currently set pet.", + help="Clears the currently set pet.\n" + "Example: !nopet" + ) + async def nopet(self, ctx: fortnitepy.ext.commands.Context) -> None: + await self.bot.party.me.clear_pet() + await ctx.send('Removed pet.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Clears the currently set contrail.", + help="Clears the currently set contrail.\n" + "Example: !nocontrail" + ) + async def nocontrail(self, ctx: fortnitepy.ext.commands.Context) -> None: + await self.bot.party.me.clear_contrail() + await ctx.send('Removed contrail.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the outfit of the client using the outfits name with the ghost variant.", + help="Sets the outfit of the client using the outfits name with the ghost variant.\n" + "Example: !ghost Meowscles" + ) + async def ghost(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + try: + skin_variants = self.bot.party.me.create_variants( + progressive=2 + ) + + cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( + lang="en", + searchLang="en", + matchMethod="contains", + name=content, + backendType="AthenaCharacter" + ) + + await self.bot.party.me.set_outfit( + asset=cosmetic.id, + variants=skin_variants + ) + + await ctx.send(f'Skin set to Ghost {cosmetic.name}!') + print(self.bot.message % f'Skin set to Ghost {cosmetic.name}.') + + except FortniteAPIAsync.exceptions.NotFound: + await ctx.send(f"Failed to find a skin with the name: {content}.") + print(self.bot.message % f"Failed to find a skin with the name: {content}.") + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the outfit of the client using the outfits name with the shadow variant.", + help="Sets the outfit of the client using the outfits name with the shadow variant.\n" + "Example: !shadow Midas" + ) + async def shadow(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + try: + skin_variants = self.bot.party.me.create_variants( + progressive=3 + ) + + cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( + lang="en", + searchLang="en", + matchMethod="contains", + name=content, + backendType="AthenaCharacter" + ) + + await self.bot.party.me.set_outfit( + asset=cosmetic.id, + variants=skin_variants + ) + + await ctx.send(f'Skin set to Shadow {cosmetic.name}!') + print(self.bot.message % f'Skin set to Ghost {cosmetic.name}.') + + except FortniteAPIAsync.exceptions.NotFound: + await ctx.send(f"Failed to find a skin with the name: {content}.") + print(self.bot.message % f"Failed to find a skin with the name: {content}.") + + @commands.dm_only() + @commands.command( + name="set", + description="[Cosmetic] Equips all cosmetics from a set.", + help="Equips all cosmetics from a set.\n" + "Example: !set Fort Knights" + ) + async def _set(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + cosmetic_types = { + "AthenaBackpack": self.bot.party.me.set_backpack, + "AthenaCharacter": self.bot.party.me.set_outfit, + "AthenaEmoji": self.bot.party.me.set_emoji, + "AthenaDance": self.bot.party.me.set_emote + } + + set_items = await self.bot.fortnite_api.cosmetics.get_cosmetics( + lang="en", + searchLang="en", + matchMethod="contains", + set=content + ) + + await ctx.send(f'Equipping all cosmetics from the {set_items[0].set["value"]} set.') + print(self.bot.message % f'Equipping all cosmetics from the {set_items[0].set["value"]} set.') + + for cosmetic in set_items: + if cosmetic.type['backendValue'] in cosmetic_types: + await cosmetic_types[cosmetic.type['backendValue']](asset=cosmetic.id) + + await ctx.send(f'{cosmetic.type["value"].capitalize()} set to {cosmetic.name}!') + print(self.bot.message % f'{cosmetic.type["value"].capitalize()} set to {cosmetic.name}.') + + await asyncio.sleep(3) + + await ctx.send(f'Finished equipping all cosmetics from the {set_items[0].set["value"]} set.') + print(self.bot.message % f'Fishing equipping all cosmetics from the {set_items[0].set["value"]} set.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Creates the variants list by the variants you set from skin name. " + "If you want to include spaces in the skin name, you need to enclose it in \"'s.", + help="Creates the variants list by the variants you set from skin name.\n" + "Example: !style \"Skull Trooper\" clothing_color 1" + ) + async def style(self, ctx: fortnitepy.ext.commands.Context, cosmetic_name: str, variant_type: str, + variant_int: str) -> None: + # cosmetic_types = { + # "AthenaCharacter": self.bot.party.me.set_outfit, + # "AthenaBackpack": self.bot.party.me.set_backpack, + # "AthenaPickaxe": self.bot.party.me.set_pickaxe + # } + + cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( + lang="en", + searchLang="en", + matchMethod="contains", + name=cosmetic_name, + backendType="AthenaCharacter" + ) + + cosmetic_variants = self.bot.party.me.create_variants( + # item=cosmetic.backend_type.value, + **{variant_type: int(variant_int) if variant_int.isdigit() else variant_int} + ) + + # await cosmetic_types[cosmetic.backend_type.value]( + await self.bot.party.me.set_outfit( + asset=cosmetic.id, + variants=cosmetic_variants + ) + + await ctx.send(f'Set variants of {cosmetic.id} to {variant_type} {variant_int}.') + print(self.bot.message % f'Set variants of {cosmetic.id} to {variant_type} {variant_int}.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Equips all new non encrypted cosmetics.", + help="Equips all new non encrypted cosmetics.\n" + "Example: !new" + ) + async def new(self, ctx: fortnitepy.ext.commands.Context, cosmetic_type: str = 'skins') -> None: + cosmetic_types = { + 'skins': { + 'id': 'AthenaCharacter', + 'function': self.bot.party.me.set_outfit + }, + 'backpacks': { + 'id': 'AthenaBackpack', + 'function': self.bot.party.me.set_backpack + }, + 'emotes': { + 'id': 'AthenaDance', + 'function': self.bot.party.me.set_emote + }, + } + + if cosmetic_type not in cosmetic_types: + return await ctx.send('Invalid cosmetic type, valid types include: skins, backpacks & emotes.') + + new_cosmetics = await self.bot.fortnite_api.cosmetics.get_new_cosmetics() + + for new_id in new_cosmetics: + print(new_id.type) + + for new_cosmetic in [new_id for new_id in new_cosmetics if + new_id.type['backendValue'] == cosmetic_types[cosmetic_type]['id']]: + await cosmetic_types[cosmetic_type]['function']( + asset=new_cosmetic.id + ) + + await ctx.send(f"{cosmetic_type[:-1].capitalize()} set to {new_cosmetic.id}.") + print(self.bot.message % f"{cosmetic_type[:-1].capitalize()} set to: {new_cosmetic.id}.") + + await asyncio.sleep(3) + + await ctx.send(f'Finished equipping all new unencrypted {cosmetic_type}.') + print(self.bot.message % f'Finished equipping all new unencrypted {cosmetic_type}.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Equips all skins currently in the item shop.", + help="Equips all skins currently in the item shop.\n" + "Example: !shop" + ) + async def shop(self, ctx: fortnitepy.ext.commands.Context) -> None: + return ctx.send('Command is broken due to the new shop catalogs, will replace soon with Fortnite-API.') + + store = await self.bot.fetch_item_shop() + + await ctx.send(f"Equipping all skins in today's item shop.") + print(self.bot.message % f"Equipping all skins in today's item shop.") + + for item in store.special_featured_items + \ + store.special_daily_items + \ + store.special_featured_items + \ + store.special_daily_items: + for grant in item.grants: + if grant['type'] == 'AthenaCharacter': + await self.bot.party.me.set_outfit( + asset=grant['asset'] + ) + + await ctx.send(f"Skin set to {item.display_names[0]}!") + print(self.bot.message % f"Skin set to: {item.display_names[0]}!") + + await asyncio.sleep(3) + + await ctx.send(f'Finished equipping all skins in the item shop.') + print(self.bot.message % f'Finished equipping all skins in the item shop.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Equips a random old default skin.", + help="Equips a random old default skin.\n" + "Example: !olddefault" + ) + async def olddefault(self, ctx: fortnitepy.ext.commands.Context) -> None: + random_default = py_random.choice( + [cid_ for cid_ in dir(fortnitepy.DefaultCharactersChapter1) if not cid_.startswith('_')] + ) + + await self.bot.party.me.set_outfit( + asset=random_default + ) + + await ctx.send(f'Skin set to {random_default}!') + print(self.bot.message % f"Skin set to {random_default}.") + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the outfit of the client to Hatless Recon Expert.", + help="Sets the outfit of the client to Hatless Recon Expert.\n" + "Example: !hatlessrecon" + ) + async def hatlessrecon(self, ctx: fortnitepy.ext.commands.Context) -> None: + skin_variants = self.bot.party.me.create_variants( + parts=2 + ) + + await self.bot.party.me.set_outfit( + asset='CID_022_Athena_Commando_F', + variants=skin_variants + ) + + await ctx.send('Skin set to Hatless Recon Expert!') + print(self.bot.message % f'Skin set to Hatless Recon Expert.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the outfit of the to the max tier skin in the defined season.", + help="Sets the outfit of the to the max tier skin in the defined season.\n" + "Example: !season 2" + ) + async def season(self, ctx: fortnitepy.ext.commands.Context, br_season: int) -> None: + max_tier_skins = { + 1: "CID_028_Athena_Commando_F", + 2: "CID_035_Athena_Commando_M_Medieval", + 3: "CID_084_Athena_Commando_M_Assassin", + 4: "CID_116_Athena_Commando_M_CarbideBlack", + 5: "CID_165_Athena_Commando_M_DarkViking", + 6: "CID_230_Athena_Commando_M_Werewolf", + 7: "CID_288_Athena_Commando_M_IceKing", + 8: "CID_352_Athena_Commando_F_Shiny", + 9: "CID_407_Athena_Commando_M_BattleSuit", + 10: "CID_484_Athena_Commando_M_KnightRemix", + 11: "CID_572_Athena_Commando_M_Viper", + 12: "CID_694_Athena_Commando_M_CatBurglar", + 13: "CID_767_Athena_Commando_F_BlackKnight", + 14: "CID_843_Athena_Commando_M_HightowerTomato_Casual", + 15: "CID_967_Athena_Commando_M_AncientGladiator", + 16: "CID_A_038_Athena_Commando_F_TowerSentinel", + 17: "CID_A_112_Athena_Commando_M_Ruckus", + 18: "CID_A_197_Athena_Commando_M_Clash", + 19: "CID_572_Athena_Commando_M_Viper", + 20: "CID_A_367_Athena_Commando_M_Mystic", + 21: "CID_A_422_Athena_Commando_M_Realm", + 22: "Character_RoseDust", + 23: "Character_Citadel", + 24: "Character_NitroFlow", + 25: "Character_LoudPhoenix", + 26: "Character_LazarusLens", + 27: "Character_HornedJudgment_Midgard", + 28: "Character_ZebraScramble_Bacon", + 29: "Character_DarkStance_Inferno" + } + + await self.bot.party.me.set_outfit(asset=max_tier_skins[br_season]) + + await ctx.send(f'Skin set to {max_tier_skins[br_season]}!') + print(self.bot.message % f"Skin set to {max_tier_skins[br_season]}.") + + @commands.dm_only() + @commands.command( + aliases=['henchmen'], + description="[Cosmetic] Sets the outfit of the client to a random Henchman skin.", + help="Sets the outfit of the client to a random Henchman skin.\n" + "Example: !henchman" + ) + async def henchman(self, ctx: fortnitepy.ext.commands.Context) -> None: + random_henchman = py_random.choice( + [ + "CID_794_Athena_Commando_M_HenchmanBadShorts_D", + "CID_NPC_Athena_Commando_F_HenchmanSpyDark", + "CID_791_Athena_Commando_M_HenchmanGoodShorts_D", + "CID_780_Athena_Commando_M_HenchmanBadShorts", + "CID_NPC_Athena_Commando_M_HenchmanGood", + "CID_692_Athena_Commando_M_HenchmanTough", + "CID_707_Athena_Commando_M_HenchmanGood", + "CID_792_Athena_Commando_M_HenchmanBadShorts_B", + "CID_793_Athena_Commando_M_HenchmanBadShorts_C", + "CID_NPC_Athena_Commando_M_HenchmanBad", + "CID_790_Athena_Commando_M_HenchmanGoodShorts_C", + "CID_779_Athena_Commando_M_HenchmanGoodShorts", + "CID_NPC_Athena_Commando_F_RebirthDefault_Henchman", + "CID_NPC_Athena_Commando_F_HenchmanSpyGood", + "CID_706_Athena_Commando_M_HenchmanBad", + "CID_789_Athena_Commando_M_HenchmanGoodShorts_B" + ] + ) + + await self.bot.party.me.set_outfit( + asset=random_henchman + ) + + await ctx.send(f'Skin set to {random_henchman}!') + print(self.bot.message % f"Skin set to {random_henchman}.") + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the emote of the client to Floss.", + help="Sets the emote of the client to Floss.\n" + "Example: !floss" + ) + async def floss(self, ctx: fortnitepy.ext.commands.Context) -> None: + # // You caused this FunGames, you caused this... + await self.bot.party.me.set_emote( + asset='EID_Floss' + ) + + await ctx.send('Emote set to Floss!') + print(self.bot.message % f"Emote set to Floss.") + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the outfit of the client to a random marauder skin.", + help="Sets the outfit of the client to a random marauder skin.\n" + "Example: !marauder" + ) + async def marauder(self, ctx: fortnitepy.ext.commands.Context) -> None: + random_marauder = py_random.choice( + [ + "CID_NPC_Athena_Commando_M_MarauderHeavy", + "CID_NPC_Athena_Commando_M_MarauderElite", + "CID_NPC_Athena_Commando_M_MarauderGrunt" + ] + ) + + await self.bot.party.me.set_outfit( + asset=random_marauder + ) + + await ctx.send(f'Skin set to {random_marauder}!') + print(self.bot.message % f"Skin set to {random_marauder}.") + + @commands.dm_only() + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the outfit of the client to Golden Brutus " + "(shortcut for !enlightened CID_692_Athena_Commando_M_HenchmanTough 2 180).", + help="Sets the outfit of the client to Golden Brutus.\n" + "Example: !goldenbrutus" + ) + async def goldenbrutus(self, ctx: fortnitepy.ext.commands.Context) -> None: + await self.bot.party.me.set_outfit( + asset='CID_692_Athena_Commando_M_HenchmanTough', + variants=self.bot.party.me.create_variants(progressive=4), + enlightenment=(2, 180) + ) + + await ctx.send(f'Skin set to Golden Brutus.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the outfit of the client to Golden Meowscles " + "(shortcut for !enlightened CID_693_Athena_Commando_M_BuffCat 2 220).", + help="Sets the outfit of the client to Golden Meowscles.\n" + "Example: !goldenmeowscles" + ) + async def goldenmeowscles(self, ctx: fortnitepy.ext.commands.Context) -> None: + await self.bot.party.me.set_outfit( + asset='CID_693_Athena_Commando_M_BuffCat', + variants=self.bot.party.me.create_variants(progressive=4), + enlightenment=(2, 220) + ) + + await ctx.send(f'Skin set to Golden Meowscles.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the outfit of the client to Golden Midas " + "(shortcut for !enlightened CID_694_Athena_Commando_M_CatBurglar 2 140).", + help="Sets the outfit of the client to Golden Peely.\n" + "Example: !goldenmidas" + ) + async def goldenmidas(self, ctx: fortnitepy.ext.commands.Context) -> None: + await self.bot.party.me.set_outfit( + asset='CID_694_Athena_Commando_M_CatBurglar', + variants=self.bot.party.me.create_variants(progressive=4), + enlightenment=(2, 140) + ) + + await ctx.send(f'Skin set to Golden Midas.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the outfit of the client to Golden Skye " + "(shortcut for !enlightened CID_690_Athena_Commando_F_Photographer 2 300).", + help="Sets the outfit of the client to Golden Skye.\n" + "Example: !goldenskye" + ) + async def goldenskye(self, ctx: fortnitepy.ext.commands.Context) -> None: + await self.bot.party.me.set_outfit( + asset='CID_690_Athena_Commando_F_Photographer', + variants=self.bot.party.me.create_variants(progressive=4), + enlightenment=(2, 300) + ) + + await ctx.send(f'Skin set to Golden Skye.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Sets the outfit of the client to Golden TNTina " + "(shortcut for !enlightened CID_691_Athena_Commando_F_TNTina 2 350).", + help="Sets the outfit of the client to Golden TNTina.\n" + "Example: !goldentntina" + ) + async def goldentntina(self, ctx: fortnitepy.ext.commands.Context) -> None: + await self.bot.party.me.set_outfit( + asset='CID_691_Athena_Commando_F_TNTina', + variants=self.bot.party.me.create_variants(progressive=7), + enlightenment=(2, 260) + ) + + await ctx.send(f'Skin set to Golden TNTina.') + + @commands.dm_only() + @commands.command( + description="[Cosmetic] Equips a To-Be-Determined outfit.", + help="Equips a To-Be-Determined outfit.\n" + "Example: !tbd 2" + ) + async def tbd(self, ctx: fortnitepy.ext.commands.Context, skin: int = 1) -> None: + cosmetics = await self.bot.fortnite_api.cosmetics.get_cosmetics( + lang="en", + searchLang="en", + matchMethod="full", + name="TBD", + backendType="AthenaCharacter" + ) + + if not skin or skin > len(cosmetics): + return await ctx.send(f'Invalid skin number, there is only {len(cosmetics)} TBD outfits.') + + await ctx.send(f'Found {len(cosmetics)} TBD outfits.') + + await self.bot.party.me.set_outfit(asset=cosmetics[skin - 1].id) + + await ctx.send(f'Skin set to {cosmetics[skin - 1].id}\nUse !tbd <1 to {len(cosmetics)}> to equip another.') print(self.bot.message % f"Set skin to: {cosmetics[skin - 1].id}.") \ No newline at end of file From 673c6d1d2afa69f5057843839c900e3309e7b7d1 Mon Sep 17 00:00:00 2001 From: Oli <55298769+xMistt@users.noreply.github.com> Date: Mon, 20 May 2024 11:27:39 +0100 Subject: [PATCH 5/9] fix player being invisible swapped out fortnitepy for my fork called rebootpy which has updated party member meta so the bot actually works again, will update/fix rest later --- fortnite.py | 2 +- partybot/bot.py | 36 +++---- partybot/client.py | 20 ++-- partybot/cosmetic.py | 247 ++++++++++++++++++++++--------------------- partybot/party.py | 99 +++++++++-------- 5 files changed, 205 insertions(+), 199 deletions(-) diff --git a/fortnite.py b/fortnite.py index f0508db..4bb3d1c 100755 --- a/fortnite.py +++ b/fortnite.py @@ -37,7 +37,7 @@ # Third party imports. import partybot import aiofiles - import fortnitepy + import rebootpy import crayons import aiohttp except ModuleNotFoundError as e: diff --git a/partybot/bot.py b/partybot/bot.py index 0691884..8603bbb 100644 --- a/partybot/bot.py +++ b/partybot/bot.py @@ -32,9 +32,9 @@ import asyncio # Third party imports. -from fortnitepy.ext import commands +from rebootpy.ext import commands -import fortnitepy +import rebootpy import crayons import FortniteAPIAsync import pypresence @@ -54,13 +54,13 @@ def __init__(self, settings: BotSettings, device_auths: DeviceAuths) -> None: super().__init__( command_prefix='!', - auth=fortnitepy.DeviceAuth( + auth=rebootpy.DeviceAuth( device_id=self.device_auths.device_id, account_id=self.device_auths.account_id, secret=self.device_auths.secret ), status=self.settings.status, - platform=fortnitepy.Platform(self.settings.platform) + platform=rebootpy.Platform(self.settings.platform) ) @property @@ -125,7 +125,7 @@ async def event_ready(self) -> None: print(crayons.green(self.message % f'Client ready as {self.user.display_name}.')) if self.party.me.leader: - await self.party.set_privacy(fortnitepy.PartyPrivacy.PUBLIC) + await self.party.set_privacy(rebootpy.PartyPrivacy.PUBLIC) # discord_exists = await self.loop.run_in_executor(None, HelperFunctions.check_if_process_running, 'Discord') @@ -144,23 +144,23 @@ async def event_ready(self) -> None: for pending in self.incoming_pending_friends: try: epic_friend = await pending.accept() if self.settings.friend_accept else await pending.decline() - if isinstance(epic_friend, fortnitepy.Friend): + if isinstance(epic_friend, rebootpy.Friend): print(self.message % f"Accepted friend request from: {epic_friend.display_name}.") else: print(self.message % f"Declined friend request from: {pending.display_name}.") - except fortnitepy.HTTPException as epic_error: + except rebootpy.HTTPException as epic_error: if epic_error.message_code != 'errors.com.epicgames.common.throttled': raise await asyncio.sleep(int(epic_error.message_vars[0] + 1)) await pending.accept() if self.settings.friend_accept else await pending.decline() - async def event_party_invite(self, invite: fortnitepy.ReceivedPartyInvitation) -> None: + async def event_party_invite(self, invite: rebootpy.ReceivedPartyInvitation) -> None: await invite.accept() print(self.message % f'Accepted party invite from {invite.sender.display_name}.') - async def event_friend_request(self, request: fortnitepy.IncomingPendingFriend) -> None: - if isinstance(request, fortnitepy.OutgoingPendingFriend): + async def event_friend_request(self, request: rebootpy.IncomingPendingFriend) -> None: + if isinstance(request, rebootpy.OutgoingPendingFriend): return print(self.message % f"Received friend request from: {request.display_name}.") @@ -172,26 +172,26 @@ async def event_friend_request(self, request: fortnitepy.IncomingPendingFriend) await request.decline() print(self.message % f"Declined friend request from: {request.display_name}.") - async def event_party_member_join(self, member: fortnitepy.PartyMember) -> None: + async def event_party_member_join(self, member: rebootpy.PartyMember) -> None: await FortniteAPIAsync.set_default_loadout( self, self.settings.to_dict(), member ) - async def event_friend_message(self, message: fortnitepy.FriendMessage) -> None: + async def event_friend_message(self, message: rebootpy.FriendMessage) -> None: print(self.message % f'{message.author.display_name}: {message.content}') - async def event_command_error(self, ctx: fortnitepy.ext.commands.Context, - error: fortnitepy.ext.commands.CommandError) -> None: - if isinstance(error, fortnitepy.ext.commands.errors.CommandNotFound): - if isinstance(ctx.message, fortnitepy.FriendMessage): + async def event_command_error(self, ctx: rebootpy.ext.commands.Context, + error: rebootpy.ext.commands.CommandError) -> None: + if isinstance(error, rebootpy.ext.commands.errors.CommandNotFound): + if isinstance(ctx.message, rebootpy.FriendMessage): await ctx.send('Command not found, are you sure it exists?') else: pass - elif isinstance(error, fortnitepy.ext.commands.errors.MissingRequiredArgument): + elif isinstance(error, rebootpy.ext.commands.errors.MissingRequiredArgument): await ctx.send('Failed to execute commands as there are missing requirements, please check usage.') - elif isinstance(error, fortnitepy.ext.commands.errors.PrivateMessageOnly): + elif isinstance(error, rebootpy.ext.commands.errors.PrivateMessageOnly): pass else: await ctx.send(f'When trying to process !{ctx.command.name}, an error occured: "{error}"\n' diff --git a/partybot/client.py b/partybot/client.py index 3ca4c3e..642feb6 100644 --- a/partybot/client.py +++ b/partybot/client.py @@ -31,11 +31,11 @@ from typing import Optional, Union # Third party imports. -import fortnitepy +import rebootpy import aiohttp import crayons -from fortnitepy.ext import commands +from rebootpy.ext import commands class ClientCommands(commands.Cog): @@ -48,7 +48,7 @@ def __init__(self, bot: commands.Bot) -> None: help="Sends and sets the status.\n" "Example: !status Presence Unknown" ) - async def status(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + async def status(self, ctx: rebootpy.ext.commands.Context, *, content: str) -> None: await self.bot.set_presence(content) await ctx.send(f'Status set to {content}') @@ -61,7 +61,7 @@ async def status(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> help="Clears command prompt/terminal.\n" "Example: !clean" ) - async def clean(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def clean(self, ctx: rebootpy.ext.commands.Context) -> None: os.system('cls' if 'win' in sys.platform else 'clear') print(crayons.cyan(self.bot.message % f'PartyBot made by xMistt. ' @@ -78,10 +78,10 @@ async def clean(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sends and sets the status to away.\n" "Example: !away" ) - async def away(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def away(self, ctx: rebootpy.ext.commands.Context) -> None: await self.bot.set_presence( status=self.bot.status, - away=fortnitepy.AwayStatus.AWAY + away=rebootpy.AwayStatus.AWAY ) await ctx.send('Status set to away, you can use !status to revert.') @@ -94,15 +94,15 @@ async def away(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sends the most recent commit/s.\n" "Example: !update" ) - async def update(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def update(self, ctx: rebootpy.ext.commands.Context) -> None: async with aiohttp.ClientSession() as session: async with session.request( method="GET", - url="https://api.github.com/repos/xMistt/fortnitepy-bot/commits/master" + url="https://api.github.com/repos/xMistt/rebootpy-bot/commits/master" ) as request: data = await request.json() - date = fortnitepy.Client.from_iso(data['commit']['committer']['date']) + date = rebootpy.Client.from_iso(data['commit']['committer']['date']) pretty_date = f'{date.day}/{date.month}/{date.year} @ {date.hour}:{date.minute}' commit_title = data['commit']['message'].split('\n')[0] @@ -117,7 +117,7 @@ async def update(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sends the defined user a friend request.\n" "Example: !friend Ninja" ) - async def friend(self, ctx: fortnitepy.ext.commands.Context, *, epic_username: str) -> None: + async def friend(self, ctx: rebootpy.ext.commands.Context, *, epic_username: str) -> None: user = await self.bot.fetch_user(epic_username) if user is not None: diff --git a/partybot/cosmetic.py b/partybot/cosmetic.py index ce0370b..60d1fc0 100644 --- a/partybot/cosmetic.py +++ b/partybot/cosmetic.py @@ -31,12 +31,12 @@ from typing import Optional, Union, Tuple # Third party imports. -import fortnitepy +import rebootpy import aiohttp import FortniteAPIAsync import random as py_random -from fortnitepy.ext import commands +from rebootpy.ext import commands class CosmeticCommands(commands.Cog): @@ -77,7 +77,7 @@ def __init__(self, bot: commands.Bot) -> None: help="Sets the outfit of the client using the outfits name.\n" "Example: !skin Nog Ops" ) - async def skin(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + async def skin(self, ctx: rebootpy.ext.commands.Context, *, content: str) -> None: try: cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( matchMethod="contains", @@ -88,11 +88,7 @@ async def skin(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> N print(self.bot.message % f"Failed to find a skin with the name: {content}.") return await ctx.send(f"Failed to find a skin with the name: {content}.") - if "brcosmetics" in cosmetic.path.lower(): - path = f"AthenaCharacterItemDefinition'/BRCosmetics/Athena/Items/Cosmetics/Characters/{cosmetic.id}.{cosmetic.id}'" - await self.bot.party.me.set_outfit(asset=path) - else: - await self.bot.party.me.set_outfit(asset=cosmetic.id) + await self.bot.party.me.set_outfit(asset=cosmetic.id) await ctx.send(f'Skin set to {cosmetic.id}.') print(self.bot.message % f"Set skin to: {cosmetic.id}.") @@ -104,7 +100,7 @@ async def skin(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> N help="Sets the backpack of the client using the backpacks name.\n" "Example: !backpack Black Shield" ) - async def backpack(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + async def backpack(self, ctx: rebootpy.ext.commands.Context, *, content: str) -> None: try: cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( matchMethod="contains", @@ -112,14 +108,14 @@ async def backpack(self, ctx: fortnitepy.ext.commands.Context, *, content: str) backendType="AthenaBackpack" ) except FortniteAPIAsync.exceptions.NotFound: - await ctx.send(f"Failed to find a backpack with the name: {content}.") print(self.bot.message % f"Failed to find a backpack with the name: {content}.") + return await ctx.send(f"Failed to find a backpack with the name: {content}.") if "brcosmetics" in cosmetic.path.lower(): - path = f"AthenaCharacterItemDefinition'/BRCosmetics/Athena/Items/Cosmetics/Backpacks/{cosmetic.id}.{cosmetic.id}'" - await self.bot.party.me.set_backpack(asset=path) + await self.bot.party.me.set_backpack(asset=cosmetic.id) else: - await self.bot.party.me.set_outfit(asset=cosmetic.id) + path = f"/Game/Athena/Items/Cosmetics/Backpacks/{cosmetic.id}.{cosmetic.id}" + await self.bot.party.me.set_backpack(asset=path) await ctx.send(f'Backpack set to {cosmetic.id}.') print(self.bot.message % f"Set backpack to: {cosmetic.id}.") @@ -130,7 +126,7 @@ async def backpack(self, ctx: fortnitepy.ext.commands.Context, *, content: str) help="Sets the emote of the client using the emotes name.\n" "Example: !emote Windmill Floss" ) - async def emote(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + async def emote(self, ctx: rebootpy.ext.commands.Context, *, content: str) -> None: try: cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( matchMethod="contains", @@ -138,16 +134,15 @@ async def emote(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> backendType="AthenaDance" ) except FortniteAPIAsync.exceptions.NotFound: - await ctx.send(f"Failed to find an emote with the name: {content}.") print(self.bot.message % f"Failed to find an emote with the name: {content}.") + return await ctx.send(f"Failed to find an emote with the name: {content}.") + await self.bot.party.me.clear_emote() if "brcosmetics" in cosmetic.path.lower(): - path = f"AthenaCharacterItemDefinition'/BRCosmetics/Athena/Items/Cosmetics/Dances/{cosmetic.id}.{cosmetic.id}'" - await self.bot.party.me.clear_emote() - await self.bot.party.me.set_emote(asset=path) - else: - await self.bot.party.me.clear_emote() await self.bot.party.me.set_emote(asset=cosmetic.id) + else: + path = f"/Game/Athena/Items/Cosmetics/Dances/{cosmetic.id}.{cosmetic.id}" + await self.bot.party.me.set_emote(asset=path) await ctx.send(f'Emote set to {cosmetic.id}.') print(self.bot.message % f"Set emote to: {cosmetic.id}.") @@ -158,23 +153,25 @@ async def emote(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> help="Sets the pickaxe of the client using the pickaxe name.\n" "Example: !pickaxe Raider's Revenge" ) - async def pickaxe(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + async def pickaxe(self, ctx: rebootpy.ext.commands.Context, *, content: str) -> None: try: cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( - lang="en", - searchLang="en", matchMethod="contains", name=content, backendType="AthenaPickaxe" ) + except FortniteAPIAsync.exceptions.NotFound: + print(self.bot.message % f"Failed to find a pickaxe with the name: {content}.") + return await ctx.send(f"Failed to find a pickaxe with the name: {content}.") - await ctx.send(f'Pickaxe set to {cosmetic.id}.') - print(self.bot.message % f"Set pickaxe to: {cosmetic.id}.") + if "brcosmetics" in cosmetic.path.lower(): await self.bot.party.me.set_pickaxe(asset=cosmetic.id) + else: + path = f"/Game/Athena/Items/Cosmetics/PickAxes/{cosmetic.id}.{cosmetic.id}" + await self.bot.party.me.set_pickaxe(asset=path) - except FortniteAPIAsync.exceptions.NotFound: - await ctx.send(f"Failed to find a pickaxe with the name: {content}.") - print(self.bot.message % f"Failed to find a pickaxe with the name: {content}.") + await ctx.send(f'Pickaxe set to {cosmetic.id}.') + print(self.bot.message % f"Set pickaxe to: {cosmetic.id}.") @commands.dm_only() @commands.command( @@ -182,23 +179,25 @@ async def pickaxe(self, ctx: fortnitepy.ext.commands.Context, *, content: str) - help="Sets the pet (backpack) of the client using the pets name.\n" "Example: !pet Bonesy" ) - async def pet(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + async def pet(self, ctx: rebootpy.ext.commands.Context, *, content: str) -> None: try: cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( - lang="en", - searchLang="en", matchMethod="contains", name=content, backendType="AthenaPetCarrier" ) + except FortniteAPIAsync.exceptions.NotFound: + print(self.bot.message % f"Failed to find a pet with the name: {content}.") + return await ctx.send(f"Failed to find a pet with the name: {content}.") - await ctx.send(f'Pet set to {cosmetic.id}.') - print(self.bot.message % f"Set pet to: {cosmetic.id}.") + if "brcosmetics" in cosmetic.path.lower(): await self.bot.party.me.set_pet(asset=cosmetic.id) + else: + path = f"/Game/Athena/Items/Cosmetics/PetCarriers/{cosmetic.id}.{cosmetic.id}" + await self.bot.party.me.set_pet(asset=path) - except FortniteAPIAsync.exceptions.NotFound: - await ctx.send(f"Failed to find a pet with the name: {content}.") - print(self.bot.message % f"Failed to find a pet with the name: {content}.") + await ctx.send(f'Pet set to {cosmetic.id}.') + print(self.bot.message % f"Set pet to: {cosmetic.id}.") @commands.dm_only() @commands.command( @@ -206,23 +205,26 @@ async def pet(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> No help="Sets the emoji of the client using the emojis name.\n" "Example: !emoji Snowball" ) - async def emoji(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + async def emoji(self, ctx: rebootpy.ext.commands.Context, *, content: str) -> None: try: cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( - lang="en", - searchLang="en", matchMethod="contains", name=content, backendType="AthenaEmoji" ) + except FortniteAPIAsync.exceptions.NotFound: + print(self.bot.message % f"Failed to find an emoji with the name: {content}.") + return await ctx.send(f"Failed to find an emoji with the name: {content}.") - await ctx.send(f'Emoji set to {cosmetic.id}.') - print(self.bot.message % f"Set emoji to: {cosmetic.id}.") + await self.bot.party.me.clear_emote() + if "brcosmetics" in cosmetic.path.lower(): await self.bot.party.me.set_emoji(asset=cosmetic.id) + else: + path = f"/Game/Athena/Items/Cosmetics/Dances/Emoji/{cosmetic.id}.{cosmetic.id}" + await self.bot.party.me.set_emoji(asset=path) - except FortniteAPIAsync.exceptions.NotFound: - await ctx.send(f"Failed to find an emoji with the name: {content}.") - print(self.bot.message % f"Failed to find an emoji with the name: {content}.") + await ctx.send(f'Emoji set to {cosmetic.id}.') + print(self.bot.message % f"Set emoji to: {cosmetic.id}.") @commands.dm_only() @commands.command( @@ -230,23 +232,25 @@ async def emoji(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> help="Sets the contrail of the client using the contrail name.\n" "Example: !contrail Holly And Divey" ) - async def contrail(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + async def contrail(self, ctx: rebootpy.ext.commands.Context, *, content: str) -> None: try: cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( - lang="en", - searchLang="en", matchMethod="contains", name=content, backendType="AthenaSkyDiveContrail" ) + except FortniteAPIAsync.exceptions.NotFound: + print(self.bot.message % f"Failed to find an contrail with the name: {content}.") + return await ctx.send(f"Failed to find a contrail with the name: {content}.") - await ctx.send(f'Contrail set to {cosmetic.id}.') - print(self.bot.message % f"Set contrail to: {cosmetic.id}.") + if "brcosmetics" in cosmetic.path.lower(): await self.bot.party.me.set_contrail(asset=cosmetic.id) + else: + path = f"/Game/Athena/Items/Cosmetics/Contrails/{cosmetic.id}.{cosmetic.id}" + await self.bot.party.me.set_contrail(asset=path) - except FortniteAPIAsync.exceptions.NotFound: - await ctx.send(f"Failed to find a contrail with the name: {content}.") - print(self.bot.message % f"Failed to find an contrail with the name: {content}.") + await ctx.send(f'Contrail set to {cosmetic.id}.') + print(self.bot.message % f"Set contrail to: {cosmetic.id}.") @commands.dm_only() @commands.command( @@ -254,7 +258,7 @@ async def contrail(self, ctx: fortnitepy.ext.commands.Context, *, content: str) help="Sets the outfit of the client to Purple Skull Trooper.\n" "Example: !purpleskull" ) - async def purpleskull(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def purpleskull(self, ctx: rebootpy.ext.commands.Context) -> None: skin_variants = self.bot.party.me.create_variants( clothing_color=1 ) @@ -273,7 +277,7 @@ async def purpleskull(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the outfit of the client to Pink Ghoul Trooper.\n" "Example: !pinkghoul" ) - async def pinkghoul(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def pinkghoul(self, ctx: rebootpy.ext.commands.Context) -> None: skin_variants = self.bot.party.me.create_variants( material=3 ) @@ -292,7 +296,7 @@ async def pinkghoul(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the backpack of the client to Purple Ghost Portal.\n" "Example: !purpleportal" ) - async def purpleportal(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def purpleportal(self, ctx: rebootpy.ext.commands.Context) -> None: skin_variants = self.bot.party.me.create_variants( config_overrides={ 'particle': 'Particle{}' @@ -314,7 +318,7 @@ async def purpleportal(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the outfit of the client using CID.\n" "Example: !cid CID_047_Athena_Commando_F_HolidayReindeer" ) - async def cid(self, ctx: fortnitepy.ext.commands.Context, character_id: str) -> None: + async def cid(self, ctx: rebootpy.ext.commands.Context, character_id: str) -> None: await self.bot.party.me.set_outfit( asset=character_id, variants=self.bot.party.me.create_variants(profile_banner='ProfileBanner') @@ -330,7 +334,7 @@ async def cid(self, ctx: fortnitepy.ext.commands.Context, character_id: str) -> # help="Creates the variants list by the variants you set using VTID.\n" # "Example: !vtid VTID_052_Skull_Trooper_RedFlames" # ) - # async def vtid(self, ctx: fortnitepy.ext.commands.Context, variant_token: str) -> None: + # async def vtid(self, ctx: rebootpy.ext.commands.Context, variant_token: str) -> None: # variant_id = await self.set_vtid(variant_token) # # if variant_id[1].lower() == 'particle': @@ -349,7 +353,7 @@ async def cid(self, ctx: fortnitepy.ext.commands.Context, character_id: str) -> help="Creates the variants list by the variants you set.\n" "Example: !variants CID_030_Athena_Commando_M_Halloween clothing_color 1" ) - async def variants(self, ctx: fortnitepy.ext.commands.Context, cosmetic_id: str, variant_type: str, + async def variants(self, ctx: rebootpy.ext.commands.Context, cosmetic_id: str, variant_type: str, variant_int: str) -> None: if 'cid' in cosmetic_id.lower() and 'jersey_color' not in variant_type.lower(): skin_variants = self.bot.party.me.create_variants( @@ -401,7 +405,7 @@ async def variants(self, ctx: fortnitepy.ext.commands.Context, cosmetic_id: str, help="Sets the outfit of the client to Checkered Renegade.\n" "Example: !checkeredrenegade" ) - async def checkeredrenegade(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def checkeredrenegade(self, ctx: rebootpy.ext.commands.Context) -> None: skin_variants = self.bot.party.me.create_variants( material=2 ) @@ -420,7 +424,7 @@ async def checkeredrenegade(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the outfit of the client to Minty Elf.\n" "Example: !mintyelf" ) - async def mintyelf(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def mintyelf(self, ctx: rebootpy.ext.commands.Context) -> None: skin_variants = self.bot.party.me.create_variants( material=2 ) @@ -439,7 +443,7 @@ async def mintyelf(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the emote of the client using EID.\n" "Example: !eid EID_Floss" ) - async def eid(self, ctx: fortnitepy.ext.commands.Context, emote_id: str) -> None: + async def eid(self, ctx: rebootpy.ext.commands.Context, emote_id: str) -> None: await self.bot.party.me.clear_emote() await self.bot.party.me.set_emote( asset=emote_id @@ -453,7 +457,7 @@ async def eid(self, ctx: fortnitepy.ext.commands.Context, emote_id: str) -> None help="Clears/stops the emote currently playing.\n" "Example: !stop" ) - async def stop(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def stop(self, ctx: rebootpy.ext.commands.Context) -> None: await self.bot.party.me.clear_emote() await ctx.send('Stopped emoting.') print(self.bot.message % f'Stopped emoting.') @@ -464,7 +468,7 @@ async def stop(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the backpack of the client using BID.\n" "Example: !bid BID_023_Pinkbear" ) - async def bid(self, ctx: fortnitepy.ext.commands.Context, backpack_id: str) -> None: + async def bid(self, ctx: rebootpy.ext.commands.Context, backpack_id: str) -> None: await self.bot.party.me.set_backpack( asset=backpack_id ) @@ -479,7 +483,7 @@ async def bid(self, ctx: fortnitepy.ext.commands.Context, backpack_id: str) -> N help="Sets the pickaxe of the client using PICKAXE_ID\n" "Example: !pickaxe_id Pickaxe_ID_073_Balloon" ) - async def pickaxe_id(self, ctx: fortnitepy.ext.commands.Context, pickaxe_id_: str) -> None: + async def pickaxe_id(self, ctx: rebootpy.ext.commands.Context, pickaxe_id_: str) -> None: await self.bot.party.me.set_pickaxe( asset=pickaxe_id_ ) @@ -493,7 +497,7 @@ async def pickaxe_id(self, ctx: fortnitepy.ext.commands.Context, pickaxe_id_: st help="Sets the pet of the client using PetCarrier_.\n" "Example: !pet_carrier PetCarrier_002_Chameleon" ) - async def pet_carrier(self, ctx: fortnitepy.ext.commands.Context, pet_carrier_id: str) -> None: + async def pet_carrier(self, ctx: rebootpy.ext.commands.Context, pet_carrier_id: str) -> None: await self.bot.party.me.set_pet( asset=pet_carrier_id ) @@ -507,7 +511,7 @@ async def pet_carrier(self, ctx: fortnitepy.ext.commands.Context, pet_carrier_id help="Sets the emoji of the client using Emoji_.\n" "Example: !emoji_id Emoji_PeaceSign" ) - async def emoji_id(self, ctx: fortnitepy.ext.commands.Context, emoji_: str) -> None: + async def emoji_id(self, ctx: rebootpy.ext.commands.Context, emoji_: str) -> None: await self.bot.party.me.clear_emote() await self.bot.party.me.set_emoji( asset=emoji_ @@ -522,7 +526,7 @@ async def emoji_id(self, ctx: fortnitepy.ext.commands.Context, emoji_: str) -> N help="Sets the contrail of the client using Trails_.\n" "Example: !trails Trails_ID_075_Celestial" ) - async def trails(self, ctx: fortnitepy.ext.commands.Context, trails_: str) -> None: + async def trails(self, ctx: rebootpy.ext.commands.Context, trails_: str) -> None: await self.bot.party.me.set_contrail( asset=trails_ ) @@ -538,7 +542,7 @@ async def trails(self, ctx: fortnitepy.ext.commands.Context, trails_: str) -> No "specified, only the emote will be played.\n" "Example: !point Pickaxe_ID_029_Assassin" ) - async def point(self, ctx: fortnitepy.ext.commands.Context, *, content: Optional[str] = None) -> None: + async def point(self, ctx: rebootpy.ext.commands.Context, *, content: Optional[str] = None) -> None: if content is None: await self.bot.party.me.set_emote(asset='EID_None') await self.bot.party.me.set_emote(asset='EID_IceKing') @@ -551,19 +555,24 @@ async def point(self, ctx: fortnitepy.ext.commands.Context, *, content: Optional else: try: cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( - lang="en", - searchLang="en", matchMethod="contains", name=content, backendType="AthenaPickaxe" ) + except FortniteAPIAsync.exceptions.NotFound: + print(self.bot.message % f"Failed to find a pickaxe with the name: {content}.") + return await ctx.send(f"Failed to find a pickaxe with the name: {content}.") + if "brcosmetics" in cosmetic.path.lower(): await self.bot.party.me.set_pickaxe(asset=cosmetic.id) - await self.bot.party.me.set_emote(asset='EID_None') - await self.bot.party.me.set_emote(asset='EID_IceKing') - await ctx.send(f'Pickaxe set to {content} & Point it Out played.') - except FortniteAPIAsync.exceptions.NotFound: - await ctx.send(f"Failed to find a pickaxe with the name: {content}") + else: + path = f"/Game/Athena/Items/Cosmetics/PickAxes/{cosmetic.id}.{cosmetic.id}" + await self.bot.party.me.set_pickaxe(asset=path) + + await self.bot.party.me.set_emote(asset='EID_None') + await self.bot.party.me.set_emote(asset='EID_IceKing') + + await ctx.send(f'Pickaxe set to {content} & Point it Out played.') @commands.dm_only() @commands.command( @@ -573,7 +582,7 @@ async def point(self, ctx: fortnitepy.ext.commands.Context, *, content: Optional "the message author will be used.\n" "Example: !copy Terbau" ) - async def copy(self, ctx: fortnitepy.ext.commands.Context, *, epic_username: Optional[str] = None) -> None: + async def copy(self, ctx: rebootpy.ext.commands.Context, *, epic_username: Optional[str] = None) -> None: if epic_username is None: member = [m for m in self.bot.party.members if m.id == ctx.author.id][0] else: @@ -582,28 +591,28 @@ async def copy(self, ctx: fortnitepy.ext.commands.Context, *, epic_username: Opt await self.bot.party.me.edit( functools.partial( - fortnitepy.ClientPartyMember.set_outfit, + rebootpy.ClientPartyMember.set_outfit, asset=member.outfit, variants=member.outfit_variants ), functools.partial( - fortnitepy.ClientPartyMember.set_backpack, + rebootpy.ClientPartyMember.set_backpack, asset=member.backpack, variants=member.backpack_variants ), functools.partial( - fortnitepy.ClientPartyMember.set_pickaxe, + rebootpy.ClientPartyMember.set_pickaxe, asset=member.pickaxe, variants=member.pickaxe_variants ), functools.partial( - fortnitepy.ClientPartyMember.set_banner, + rebootpy.ClientPartyMember.set_banner, icon=member.banner[0], color=member.banner[1], season_level=member.banner[2] ), functools.partial( - fortnitepy.ClientPartyMember.set_battlepass_info, + rebootpy.ClientPartyMember.set_battlepass_info, has_purchased=True, level=member.battlepass_info[1] ) @@ -621,7 +630,7 @@ async def copy(self, ctx: fortnitepy.ext.commands.Context, *, epic_username: Opt help="Shortcut for equipping the skin CID_VIP_Athena_Commando_M_GalileoGondola_SG.\n" "Example: !hologram" ) - async def hologram(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def hologram(self, ctx: rebootpy.ext.commands.Context) -> None: await self.bot.party.me.set_outfit( asset='CID_VIP_Athena_Commando_M_GalileoGondola_SG' ) @@ -635,7 +644,7 @@ async def hologram(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Shortcut for equipping the skin CID_VIP_Athena_Commando_M_GalileoGondola_SG.\n" "Example: !gift is a joke command." ) - async def gift(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def gift(self, ctx: rebootpy.ext.commands.Context) -> None: await self.bot.party.me.clear_emote() await self.bot.party.me.set_emote( @@ -650,7 +659,7 @@ async def gift(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Shortcut for equipping the emote EID_TourBus.\n" "Example: !ponpon" ) - async def ponpon(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def ponpon(self, ctx: rebootpy.ext.commands.Context) -> None: await self.bot.party.me.set_emote( asset='EID_TourBus' ) @@ -664,7 +673,7 @@ async def ponpon(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the enlightened value of a skin.\n" "Example: !enlightened CID_701_Athena_Commando_M_BananaAgent 2 350" ) - async def enlightened(self, ctx: fortnitepy.ext.commands.Context, cosmetic_id: str, br_season: int, + async def enlightened(self, ctx: rebootpy.ext.commands.Context, cosmetic_id: str, br_season: int, skin_level: int) -> None: variant_types = { 1: self.bot.party.me.create_variants(progressive=4), @@ -699,7 +708,7 @@ async def enlightened(self, ctx: fortnitepy.ext.commands.Context, cosmetic_id: s help="Shortcut for equipping the skin CID_605_Athena_Commando_M_TourBus.\n" "Example: !ninja" ) - async def ninja(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def ninja(self, ctx: rebootpy.ext.commands.Context) -> None: await self.bot.party.me.set_outfit( asset='CID_605_Athena_Commando_M_TourBus' ) @@ -713,7 +722,7 @@ async def ninja(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Equips all very rare skins.\n" "Example: !rareskins" ) - async def rareskins(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def rareskins(self, ctx: rebootpy.ext.commands.Context) -> None: await ctx.send('Showing all rare skins now.') await self.bot.party.me.set_outfit( @@ -750,7 +759,7 @@ async def rareskins(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the outfit of the client to Golden Peely.\n" "Example: !goldenpeely" ) - async def goldenpeely(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def goldenpeely(self, ctx: rebootpy.ext.commands.Context) -> None: await self.bot.party.me.set_outfit( asset='CID_701_Athena_Commando_M_BananaAgent', variants=self.bot.party.me.create_variants(progressive=4), @@ -759,6 +768,7 @@ async def goldenpeely(self, ctx: fortnitepy.ext.commands.Context) -> None: await ctx.send(f'Skin set to Golden Peely.') + # to fix @commands.dm_only() @commands.command( description="[Cosmetic] Randomly finds & equips a skin. Types currently include skin, backpack, emote & all. " @@ -766,7 +776,7 @@ async def goldenpeely(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Randomly finds & equips a skin.\n" "Example: !random skin" ) - async def random(self, ctx: fortnitepy.ext.commands.Context, cosmetic_type: str = 'skin') -> None: + async def random(self, ctx: rebootpy.ext.commands.Context, cosmetic_type: str = 'skin') -> None: if cosmetic_type == 'skin': all_outfits = await self.bot.fortnite_api.cosmetics.get_cosmetics( lang="en", @@ -867,7 +877,7 @@ async def random(self, ctx: fortnitepy.ext.commands.Context, cosmetic_type: str help="Clears the currently set backpack.\n" "Example: !nobackpack" ) - async def nobackpack(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def nobackpack(self, ctx: rebootpy.ext.commands.Context) -> None: await self.bot.party.me.clear_backpack() await ctx.send('Removed backpack.') @@ -877,7 +887,7 @@ async def nobackpack(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Clears the currently set pet.\n" "Example: !nopet" ) - async def nopet(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def nopet(self, ctx: rebootpy.ext.commands.Context) -> None: await self.bot.party.me.clear_pet() await ctx.send('Removed pet.') @@ -887,7 +897,7 @@ async def nopet(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Clears the currently set contrail.\n" "Example: !nocontrail" ) - async def nocontrail(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def nocontrail(self, ctx: rebootpy.ext.commands.Context) -> None: await self.bot.party.me.clear_contrail() await ctx.send('Removed contrail.') @@ -897,15 +907,13 @@ async def nocontrail(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the outfit of the client using the outfits name with the ghost variant.\n" "Example: !ghost Meowscles" ) - async def ghost(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + async def ghost(self, ctx: rebootpy.ext.commands.Context, *, content: str) -> None: try: skin_variants = self.bot.party.me.create_variants( progressive=2 ) cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( - lang="en", - searchLang="en", matchMethod="contains", name=content, backendType="AthenaCharacter" @@ -920,8 +928,8 @@ async def ghost(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> print(self.bot.message % f'Skin set to Ghost {cosmetic.name}.') except FortniteAPIAsync.exceptions.NotFound: - await ctx.send(f"Failed to find a skin with the name: {content}.") print(self.bot.message % f"Failed to find a skin with the name: {content}.") + return await ctx.send(f"Failed to find a skin with the name: {content}.") @commands.dm_only() @commands.command( @@ -929,15 +937,13 @@ async def ghost(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> help="Sets the outfit of the client using the outfits name with the shadow variant.\n" "Example: !shadow Midas" ) - async def shadow(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + async def shadow(self, ctx: rebootpy.ext.commands.Context, *, content: str) -> None: try: skin_variants = self.bot.party.me.create_variants( progressive=3 ) cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( - lang="en", - searchLang="en", matchMethod="contains", name=content, backendType="AthenaCharacter" @@ -952,9 +958,10 @@ async def shadow(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> print(self.bot.message % f'Skin set to Ghost {cosmetic.name}.') except FortniteAPIAsync.exceptions.NotFound: - await ctx.send(f"Failed to find a skin with the name: {content}.") print(self.bot.message % f"Failed to find a skin with the name: {content}.") + return await ctx.send(f"Failed to find a skin with the name: {content}.") + # to fix @commands.dm_only() @commands.command( name="set", @@ -962,7 +969,7 @@ async def shadow(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> help="Equips all cosmetics from a set.\n" "Example: !set Fort Knights" ) - async def _set(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + async def _set(self, ctx: rebootpy.ext.commands.Context, *, content: str) -> None: cosmetic_types = { "AthenaBackpack": self.bot.party.me.set_backpack, "AthenaCharacter": self.bot.party.me.set_outfit, @@ -971,8 +978,6 @@ async def _set(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> N } set_items = await self.bot.fortnite_api.cosmetics.get_cosmetics( - lang="en", - searchLang="en", matchMethod="contains", set=content ) @@ -999,7 +1004,7 @@ async def _set(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> N help="Creates the variants list by the variants you set from skin name.\n" "Example: !style \"Skull Trooper\" clothing_color 1" ) - async def style(self, ctx: fortnitepy.ext.commands.Context, cosmetic_name: str, variant_type: str, + async def style(self, ctx: rebootpy.ext.commands.Context, cosmetic_name: str, variant_type: str, variant_int: str) -> None: # cosmetic_types = { # "AthenaCharacter": self.bot.party.me.set_outfit, @@ -1008,8 +1013,6 @@ async def style(self, ctx: fortnitepy.ext.commands.Context, cosmetic_name: str, # } cosmetic = await self.bot.fortnite_api.cosmetics.get_cosmetic( - lang="en", - searchLang="en", matchMethod="contains", name=cosmetic_name, backendType="AthenaCharacter" @@ -1035,7 +1038,7 @@ async def style(self, ctx: fortnitepy.ext.commands.Context, cosmetic_name: str, help="Equips all new non encrypted cosmetics.\n" "Example: !new" ) - async def new(self, ctx: fortnitepy.ext.commands.Context, cosmetic_type: str = 'skins') -> None: + async def new(self, ctx: rebootpy.ext.commands.Context, cosmetic_type: str = 'skins') -> None: cosmetic_types = { 'skins': { 'id': 'AthenaCharacter', @@ -1079,7 +1082,7 @@ async def new(self, ctx: fortnitepy.ext.commands.Context, cosmetic_type: str = ' help="Equips all skins currently in the item shop.\n" "Example: !shop" ) - async def shop(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def shop(self, ctx: rebootpy.ext.commands.Context) -> None: return ctx.send('Command is broken due to the new shop catalogs, will replace soon with Fortnite-API.') store = await self.bot.fetch_item_shop() @@ -1111,9 +1114,9 @@ async def shop(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Equips a random old default skin.\n" "Example: !olddefault" ) - async def olddefault(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def olddefault(self, ctx: rebootpy.ext.commands.Context) -> None: random_default = py_random.choice( - [cid_ for cid_ in dir(fortnitepy.DefaultCharactersChapter1) if not cid_.startswith('_')] + [cid_ for cid_ in dir(rebootpy.DefaultCharactersChapter1) if not cid_.startswith('_')] ) await self.bot.party.me.set_outfit( @@ -1129,7 +1132,7 @@ async def olddefault(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the outfit of the client to Hatless Recon Expert.\n" "Example: !hatlessrecon" ) - async def hatlessrecon(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def hatlessrecon(self, ctx: rebootpy.ext.commands.Context) -> None: skin_variants = self.bot.party.me.create_variants( parts=2 ) @@ -1148,7 +1151,7 @@ async def hatlessrecon(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the outfit of the to the max tier skin in the defined season.\n" "Example: !season 2" ) - async def season(self, ctx: fortnitepy.ext.commands.Context, br_season: int) -> None: + async def season(self, ctx: rebootpy.ext.commands.Context, br_season: int) -> None: max_tier_skins = { 1: "CID_028_Athena_Commando_F", 2: "CID_035_Athena_Commando_M_Medieval", @@ -1193,7 +1196,7 @@ async def season(self, ctx: fortnitepy.ext.commands.Context, br_season: int) -> help="Sets the outfit of the client to a random Henchman skin.\n" "Example: !henchman" ) - async def henchman(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def henchman(self, ctx: rebootpy.ext.commands.Context) -> None: random_henchman = py_random.choice( [ "CID_794_Athena_Commando_M_HenchmanBadShorts_D", @@ -1228,7 +1231,7 @@ async def henchman(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the emote of the client to Floss.\n" "Example: !floss" ) - async def floss(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def floss(self, ctx: rebootpy.ext.commands.Context) -> None: # // You caused this FunGames, you caused this... await self.bot.party.me.set_emote( asset='EID_Floss' @@ -1243,7 +1246,7 @@ async def floss(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the outfit of the client to a random marauder skin.\n" "Example: !marauder" ) - async def marauder(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def marauder(self, ctx: rebootpy.ext.commands.Context) -> None: random_marauder = py_random.choice( [ "CID_NPC_Athena_Commando_M_MarauderHeavy", @@ -1267,7 +1270,7 @@ async def marauder(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the outfit of the client to Golden Brutus.\n" "Example: !goldenbrutus" ) - async def goldenbrutus(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def goldenbrutus(self, ctx: rebootpy.ext.commands.Context) -> None: await self.bot.party.me.set_outfit( asset='CID_692_Athena_Commando_M_HenchmanTough', variants=self.bot.party.me.create_variants(progressive=4), @@ -1283,7 +1286,7 @@ async def goldenbrutus(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the outfit of the client to Golden Meowscles.\n" "Example: !goldenmeowscles" ) - async def goldenmeowscles(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def goldenmeowscles(self, ctx: rebootpy.ext.commands.Context) -> None: await self.bot.party.me.set_outfit( asset='CID_693_Athena_Commando_M_BuffCat', variants=self.bot.party.me.create_variants(progressive=4), @@ -1299,7 +1302,7 @@ async def goldenmeowscles(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the outfit of the client to Golden Peely.\n" "Example: !goldenmidas" ) - async def goldenmidas(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def goldenmidas(self, ctx: rebootpy.ext.commands.Context) -> None: await self.bot.party.me.set_outfit( asset='CID_694_Athena_Commando_M_CatBurglar', variants=self.bot.party.me.create_variants(progressive=4), @@ -1315,7 +1318,7 @@ async def goldenmidas(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the outfit of the client to Golden Skye.\n" "Example: !goldenskye" ) - async def goldenskye(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def goldenskye(self, ctx: rebootpy.ext.commands.Context) -> None: await self.bot.party.me.set_outfit( asset='CID_690_Athena_Commando_F_Photographer', variants=self.bot.party.me.create_variants(progressive=4), @@ -1331,7 +1334,7 @@ async def goldenskye(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the outfit of the client to Golden TNTina.\n" "Example: !goldentntina" ) - async def goldentntina(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def goldentntina(self, ctx: rebootpy.ext.commands.Context) -> None: await self.bot.party.me.set_outfit( asset='CID_691_Athena_Commando_F_TNTina', variants=self.bot.party.me.create_variants(progressive=7), @@ -1346,10 +1349,8 @@ async def goldentntina(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Equips a To-Be-Determined outfit.\n" "Example: !tbd 2" ) - async def tbd(self, ctx: fortnitepy.ext.commands.Context, skin: int = 1) -> None: + async def tbd(self, ctx: rebootpy.ext.commands.Context, skin: int = 1) -> None: cosmetics = await self.bot.fortnite_api.cosmetics.get_cosmetics( - lang="en", - searchLang="en", matchMethod="full", name="TBD", backendType="AthenaCharacter" diff --git a/partybot/party.py b/partybot/party.py index f91c4fc..4fc352f 100644 --- a/partybot/party.py +++ b/partybot/party.py @@ -32,11 +32,11 @@ from typing import Optional, Union # Third party imports. -import fortnitepy +import rebootpy import aiohttp import crayons -from fortnitepy.ext import commands +from rebootpy.ext import commands class PartyCommands(commands.Cog): @@ -56,13 +56,18 @@ async def get_playlist(self, display_name: str) -> str: return response['id'] if 'error' not in response else None + @commands.dm_only() + @commands.command() + async def selfmeta(ctx): + print(json.dumps(bot.party.me.meta.schema, sort_keys=False, indent=4)) + @commands.dm_only() @commands.command( description="[Party] Sets the banner of the self.bot.", help="Sets the banner of the self.bot.\n" "Example: !banner BRSeason01 defaultcolor15 100" ) - async def banner(self, ctx: fortnitepy.ext.commands.Context, + async def banner(self, ctx: rebootpy.ext.commands.Context, icon: Optional[str] = None, colour: Optional[str] = None, banner_level: Optional[int] = None @@ -78,8 +83,8 @@ async def banner(self, ctx: fortnitepy.ext.commands.Context, help="Sets the readiness of the client to ready.\n" "Example: !ready" ) - async def ready(self, ctx: fortnitepy.ext.commands.Context) -> None: - await self.bot.party.me.set_ready(fortnitepy.ReadyState.READY) + async def ready(self, ctx: rebootpy.ext.commands.Context) -> None: + await self.bot.party.me.set_ready(rebootpy.ReadyState.READY) await ctx.send('Ready!') @commands.dm_only() @@ -89,8 +94,8 @@ async def ready(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the readiness of the client to unready.\n" "Example: !unready" ) - async def unready(self, ctx: fortnitepy.ext.commands.Context) -> None: - await self.bot.party.me.set_ready(fortnitepy.ReadyState.NOT_READY) + async def unready(self, ctx: rebootpy.ext.commands.Context) -> None: + await self.bot.party.me.set_ready(rebootpy.ReadyState.NOT_READY) await ctx.send('Unready!') @commands.dm_only() @@ -99,8 +104,8 @@ async def unready(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the readiness of the client to SittingOut.\n" "Example: !sitout" ) - async def sitout(self, ctx: fortnitepy.ext.commands.Context) -> None: - await self.bot.party.me.set_ready(fortnitepy.ReadyState.SITTING_OUT) + async def sitout(self, ctx: rebootpy.ext.commands.Context) -> None: + await self.bot.party.me.set_ready(rebootpy.ReadyState.SITTING_OUT) await ctx.send('Sitting Out!') @commands.dm_only() @@ -109,7 +114,7 @@ async def sitout(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Sets the battlepass info of the self.bot.\n" "Example: !bp 100" ) - async def bp(self, ctx: fortnitepy.ext.commands.Context, tier: int) -> None: + async def bp(self, ctx: rebootpy.ext.commands.Context, tier: int) -> None: await self.bot.party.me.set_battlepass_info( has_purchased=True, level=tier, @@ -123,7 +128,7 @@ async def bp(self, ctx: fortnitepy.ext.commands.Context, tier: int) -> None: help="Sets the level of the self.bot.\n" "Example: !level 999" ) - async def level(self, ctx: fortnitepy.ext.commands.Context, banner_level: int) -> None: + async def level(self, ctx: rebootpy.ext.commands.Context, banner_level: int) -> None: await self.bot.party.me.set_banner( season_level=banner_level ) @@ -136,7 +141,7 @@ async def level(self, ctx: fortnitepy.ext.commands.Context, banner_level: int) - help="Sends message to party chat with the given content.\n" "Example: !echo i cant fix the fucking public lobby bots" ) - async def echo(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> None: + async def echo(self, ctx: rebootpy.ext.commands.Context, *, content: str) -> None: await self.bot.party.send(content) await ctx.send('Sent message to party chat.') @@ -146,7 +151,7 @@ async def echo(self, ctx: fortnitepy.ext.commands.Context, *, content: str) -> N help="Leaves the current party.\n" "Example: !leave" ) - async def leave(self, ctx: fortnitepy.ext.commands.Context) -> None: + async def leave(self, ctx: rebootpy.ext.commands.Context) -> None: await self.bot.party.me.set_emote('EID_Wave') await asyncio.sleep(2) await self.bot.party.me.leave() @@ -160,7 +165,7 @@ async def leave(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Kicks the inputted user.\n" "Example: !kick Cxnyaa" ) - async def kick(self, ctx: fortnitepy.ext.commands.Context, *, epic_username: Optional[str] = None) -> None: + async def kick(self, ctx: rebootpy.ext.commands.Context, *, epic_username: Optional[str] = None) -> None: if epic_username is None: user = await self.bot.fetch_user(ctx.author.display_name) member = self.bot.party.get_member(user.id) @@ -175,7 +180,7 @@ async def kick(self, ctx: fortnitepy.ext.commands.Context, *, epic_username: Opt await member.kick() await ctx.send(f"Kicked user: {member.display_name}.") print(self.bot.message % f"Kicked user: {member.display_name}") - except fortnitepy.errors.Forbidden: + except rebootpy.errors.Forbidden: await ctx.send(f"Failed to kick {member.display_name}, as I'm not party leader.") print(crayons.red(self.bot.message % f"[ERROR] " "Failed to kick member as I don't have the required permissions.")) @@ -188,7 +193,7 @@ async def kick(self, ctx: fortnitepy.ext.commands.Context, *, epic_username: Opt help="Promotes the defined user to party leader. If friend is left blank, the message author will be used.\n" "Example: !promote Terbau" ) - async def promote(self, ctx: fortnitepy.ext.commands.Context, *, epic_username: Optional[str] = None) -> None: + async def promote(self, ctx: rebootpy.ext.commands.Context, *, epic_username: Optional[str] = None) -> None: if epic_username is None: user = await self.bot.fetch_user(ctx.author.display_name) member = self.bot.party.get_member(user.id) @@ -203,7 +208,7 @@ async def promote(self, ctx: fortnitepy.ext.commands.Context, *, epic_username: await member.promote() await ctx.send(f"Promoted user: {member.display_name}.") print(self.bot.message % f"Promoted user: {member.display_name}") - except fortnitepy.errors.Forbidden: + except rebootpy.errors.Forbidden: await ctx.send(f"Failed topromote {member.display_name}, as I'm not party leader.") print(crayons.red(self.bot.message % f"[ERROR] " "Failed to promote member as I don't have the required permissions.")) @@ -214,11 +219,11 @@ async def promote(self, ctx: fortnitepy.ext.commands.Context, *, epic_username: help="Sets the lobbies selected playlist.\n" "Example: !playlist_id Playlist_Tank_Solo" ) - async def playlist_id(self, ctx: fortnitepy.ext.commands.Context, playlist_: str) -> None: + async def playlist_id(self, ctx: rebootpy.ext.commands.Context, playlist_: str) -> None: try: await self.bot.party.set_playlist(playlist=playlist_) await ctx.send(f'Gamemode set to {playlist_}') - except fortnitepy.errors.Forbidden: + except rebootpy.errors.Forbidden: await ctx.send(f"Failed to set gamemode to {playlist_}, as I'm not party leader.") print(crayons.red(self.bot.message % f"[ERROR] " "Failed to set gamemode as I don't have the required permissions.")) @@ -229,23 +234,23 @@ async def playlist_id(self, ctx: fortnitepy.ext.commands.Context, playlist_: str help="Sets the parties current privacy.\n" "Example: !privacy private" ) - async def privacy(self, ctx: fortnitepy.ext.commands.Context, privacy_type: str) -> None: + async def privacy(self, ctx: rebootpy.ext.commands.Context, privacy_type: str) -> None: try: if privacy_type.lower() == 'public': - await self.bot.party.set_privacy(fortnitepy.PartyPrivacy.PUBLIC) + await self.bot.party.set_privacy(rebootpy.PartyPrivacy.PUBLIC) elif privacy_type.lower() == 'private': - await self.bot.party.set_privacy(fortnitepy.PartyPrivacy.PRIVATE) + await self.bot.party.set_privacy(rebootpy.PartyPrivacy.PRIVATE) elif privacy_type.lower() == 'friends': - await self.bot.party.set_privacy(fortnitepy.PartyPrivacy.FRIENDS) + await self.bot.party.set_privacy(rebootpy.PartyPrivacy.FRIENDS) elif privacy_type.lower() == 'friends_allow_friends_of_friends': - await self.bot.party.set_privacy(fortnitepy.PartyPrivacy.FRIENDS_ALLOW_FRIENDS_OF_FRIENDS) + await self.bot.party.set_privacy(rebootpy.PartyPrivacy.FRIENDS_ALLOW_FRIENDS_OF_FRIENDS) elif privacy_type.lower() == 'private_allow_friends_of_friends': - await self.bot.party.set_privacy(fortnitepy.PartyPrivacy.PRIVATE_ALLOW_FRIENDS_OF_FRIENDS) + await self.bot.party.set_privacy(rebootpy.PartyPrivacy.PRIVATE_ALLOW_FRIENDS_OF_FRIENDS) await ctx.send(f'Party privacy set to {self.bot.party.privacy}.') print(self.bot.message % f'Party privacy set to {self.bot.party.privacy}.') - except fortnitepy.errors.Forbidden: + except rebootpy.errors.Forbidden: await ctx.send(f"Failed to set party privacy to {privacy_type}, as I'm not party leader.") print(crayons.red(self.bot.message % f"[ERROR] " "Failed to set party privacy as I don't have the required permissions.")) @@ -256,7 +261,7 @@ async def privacy(self, ctx: fortnitepy.ext.commands.Context, privacy_type: str) help="Sets the parties custom matchmaking code.\n" "Example: !matchmakingcode solo123" ) - async def matchmakingcode(self, ctx: fortnitepy.ext.commands.Context, *, custom_matchmaking_key: str) -> None: + async def matchmakingcode(self, ctx: rebootpy.ext.commands.Context, *, custom_matchmaking_key: str) -> None: await self.bot.party.set_custom_key( key=custom_matchmaking_key ) @@ -270,7 +275,7 @@ async def matchmakingcode(self, ctx: fortnitepy.ext.commands.Context, *, custom_ help="Sets the client to the \"In Match\" state.\n" "Example: !match 69 420" ) - async def match(self, ctx: fortnitepy.ext.commands.Context, players: Union[str, int] = 0, + async def match(self, ctx: rebootpy.ext.commands.Context, players: Union[str, int] = 0, match_time: int = 0) -> None: if players == 'progressive': match_time = datetime.datetime.utcnow() @@ -304,9 +309,9 @@ async def match(self, ctx: fortnitepy.ext.commands.Context, players: Union[str, help="Sets the client to normal pre-game lobby state.\n" "Example: !lobby" ) - async def lobby(self, ctx: fortnitepy.ext.commands.Context) -> None: - if self.bot.default_party_member_config.cls == fortnitepy.JustChattingClientPartyMember: - self.bot.default_party_member_config.cls = fortnitepy.ClientPartyMember + async def lobby(self, ctx: rebootpy.ext.commands.Context) -> None: + if self.bot.default_party_member_config.cls == rebootpy.JustChattingClientPartyMember: + self.bot.default_party_member_config.cls = rebootpy.ClientPartyMember party_id = self.bot.party.id await self.bot.party.me.leave() @@ -315,9 +320,9 @@ async def lobby(self, ctx: fortnitepy.ext.commands.Context) -> None: try: await self.bot.join_party(party_id) - except fortnitepy.errors.Forbidden: + except rebootpy.errors.Forbidden: await ctx.send('Failed to join back as party is set to private.') - except fortnitepy.errors.NotFound: + except rebootpy.errors.NotFound: await ctx.send('Party not found, are you sure Fortnite is open?') await self.bot.party.me.clear_in_match() @@ -331,7 +336,7 @@ async def lobby(self, ctx: fortnitepy.ext.commands.Context) -> None: help="Joins the party of the defined friend.\n" "Example: !join Terbau" ) - async def join(self, ctx: fortnitepy.ext.commands.Context, *, epic_username: Optional[str] = None) -> None: + async def join(self, ctx: rebootpy.ext.commands.Context, *, epic_username: Optional[str] = None) -> None: if epic_username is None: epic_friend = self.bot.get_friend(ctx.author.id) else: @@ -343,13 +348,13 @@ async def join(self, ctx: fortnitepy.ext.commands.Context, *, epic_username: Opt epic_friend = None await ctx.send(f'Failed to find user with the name: {epic_username}.') - if isinstance(epic_friend, fortnitepy.Friend): + if isinstance(epic_friend, rebootpy.Friend): try: await epic_friend.join_party() await ctx.send(f'Joined the party of {epic_friend.display_name}.') - except fortnitepy.errors.Forbidden: + except rebootpy.errors.Forbidden: await ctx.send('Failed to join party since it is private.') - except fortnitepy.errors.PartyError: + except rebootpy.errors.PartyError: await ctx.send('Party not found, are you sure Fortnite is open?') else: await ctx.send('Cannot join party as the friend is not found.') @@ -360,7 +365,7 @@ async def join(self, ctx: fortnitepy.ext.commands.Context, *, epic_username: Opt help="Sets the lobbies selected playlist using playlist name.\n" "Example: !playlist Food Fight" ) - async def playlist(self, ctx: fortnitepy.ext.commands.Context, *, playlist_name: str) -> None: + async def playlist(self, ctx: rebootpy.ext.commands.Context, *, playlist_name: str) -> None: try: scuffedapi_playlist_id = await self.get_playlist(playlist_name) @@ -374,7 +379,7 @@ async def playlist(self, ctx: fortnitepy.ext.commands.Context, *, playlist_name: print(crayons.red(self.bot.message % f"[ERROR] " f"Failed to find a playlist with the name: {playlist_name}.")) - except fortnitepy.errors.Forbidden: + except rebootpy.errors.Forbidden: await ctx.send(f"Failed to set playlist to {playlist_name}, as I'm not party leader.") print(crayons.red(self.bot.message % f"[ERROR] " "Failed to set playlist as I don't have the required permissions.")) @@ -387,7 +392,7 @@ async def playlist(self, ctx: fortnitepy.ext.commands.Context, *, playlist_name: help="Invites the defined friend to the party.\n" "Example: !invite Terbau" ) - async def _invite(self, ctx: fortnitepy.ext.commands.Context, *, epic_username: Optional[str] = None) -> None: + async def _invite(self, ctx: rebootpy.ext.commands.Context, *, epic_username: Optional[str] = None) -> None: if epic_username is None: epic_friend = self.bot.get_friend(ctx.author.id) else: @@ -401,12 +406,12 @@ async def _invite(self, ctx: fortnitepy.ext.commands.Context, *, epic_username: print(crayons.red(self.bot.message % f"[ERROR] " f"Failed to find user with the name: {epic_username}.")) - if isinstance(epic_friend, fortnitepy.Friend): + if isinstance(epic_friend, rebootpy.Friend): try: await epic_friend.invite() await ctx.send(f'Invited {epic_friend.display_name} to the party.') print(self.bot.message % f"[ERROR] Invited {epic_friend.display_name} to the party.") - except fortnitepy.errors.PartyError: + except rebootpy.errors.PartyError: await ctx.send('Failed to invite friend as they are either already in the party or it is full.') print(crayons.red(self.bot.message % f"[ERROR] " "Failed to invite to party as friend is already either in party or it is full.")) @@ -422,7 +427,7 @@ async def _invite(self, ctx: fortnitepy.ext.commands.Context, *, epic_username: help="Hides members of the party.\n" "Example: !hide" ) - async def hide(self, ctx: fortnitepy.ext.commands.Context, party_member: Optional[str] = None) -> None: + async def hide(self, ctx: rebootpy.ext.commands.Context, party_member: Optional[str] = None) -> None: if self.bot.party.me.leader: if party_member is not None: user = await self.bot.fetch_user(party_member) @@ -467,8 +472,8 @@ async def hide(self, ctx: fortnitepy.ext.commands.Context, party_member: Optiona help="Sets the client to the \"Just Chattin'\" state.\n" "Example: !justchattin" ) - async def justchattin(self, ctx: fortnitepy.ext.commands.Context) -> None: - self.bot.default_party_member_config.cls = fortnitepy.JustChattingClientPartyMember + async def justchattin(self, ctx: rebootpy.ext.commands.Context) -> None: + self.bot.default_party_member_config.cls = rebootpy.JustChattingClientPartyMember party_id = self.bot.party.id await self.bot.party.me.leave() @@ -478,7 +483,7 @@ async def justchattin(self, ctx: fortnitepy.ext.commands.Context) -> None: try: await self.bot.join_party(party_id) - except fortnitepy.errors.Forbidden: + except rebootpy.errors.Forbidden: await ctx.send('Failed to join back as party is set to private.') - except fortnitepy.errors.NotFound: + except rebootpy.errors.NotFound: await ctx.send('Party not found, are you sure Fortnite is open?') From 7ac539abc08deef70c50dc438522339ec522004b Mon Sep 17 00:00:00 2001 From: Oli <55298769+xMistt@users.noreply.github.com> Date: Mon, 20 May 2024 11:28:05 +0100 Subject: [PATCH 6/9] update requirements --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 39e7d12..9404472 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -fortnitepy +rebootpy BenBotAsync crayons pypresence @@ -8,4 +8,4 @@ cryptography==3.2.1 aioconsole pytz tzdata -tzlocal \ No newline at end of file +tzlocal From f3bdece0b9a9aadbc1c976ddcbbfee7247f8a19c Mon Sep 17 00:00:00 2001 From: Oli <55298769+xMistt@users.noreply.github.com> Date: Thu, 11 Jul 2024 11:31:40 +0100 Subject: [PATCH 7/9] catch exception --- fortnite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fortnite.py b/fortnite.py index 4bb3d1c..2c08190 100755 --- a/fortnite.py +++ b/fortnite.py @@ -90,7 +90,7 @@ async def main() -> None: timeout=3 ) as r: invite = (await r.json())['invite'] if r.status == 200 else "8heARRB" - except asyncio.TimeoutError: + except (asyncio.TimeoutError, aiohttp.client_exceptiosn.ContenTypeError): invite = "8heARRB" print(crayons.cyan(f"[PartyBot] [{datetime.datetime.now().strftime('%H:%M:%S')}] PartyBot made by xMistt. " From d234e19973251cad31b990731eb9d540015c931b Mon Sep 17 00:00:00 2001 From: Oli <55298769+xMistt@users.noreply.github.com> Date: Thu, 11 Jul 2024 11:31:56 +0100 Subject: [PATCH 8/9] fix typo --- fortnite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fortnite.py b/fortnite.py index 2c08190..a8e6e41 100755 --- a/fortnite.py +++ b/fortnite.py @@ -90,7 +90,7 @@ async def main() -> None: timeout=3 ) as r: invite = (await r.json())['invite'] if r.status == 200 else "8heARRB" - except (asyncio.TimeoutError, aiohttp.client_exceptiosn.ContenTypeError): + except (asyncio.TimeoutError, aiohttp.client_exceptions.ContenTypeError): invite = "8heARRB" print(crayons.cyan(f"[PartyBot] [{datetime.datetime.now().strftime('%H:%M:%S')}] PartyBot made by xMistt. " From 95d64574498bcb392808daa0e2a033c431f8b5cd Mon Sep 17 00:00:00 2001 From: Jaws <38185563+Jawschamp@users.noreply.github.com> Date: Wed, 23 Oct 2024 23:55:45 -0700 Subject: [PATCH 9/9] Update generator.py add another likely error (tested) --- partybot/generator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/partybot/generator.py b/partybot/generator.py index efd0d3e..0281c79 100644 --- a/partybot/generator.py +++ b/partybot/generator.py @@ -139,6 +139,8 @@ async def wait_for_device_code_completion(self, code: str) -> EpicUser: pass elif token['errorCode'] == 'errors.com.epicgames.not_found': pass + elif token["errorCode"] == "errors.com.epicgames.common.slow_down": + pass else: print(json.dumps(token, sort_keys=False, indent=4))