Skip to content
This repository was archived by the owner on Jan 1, 2023. It is now read-only.

Latest commit

 

History

History
executable file
·
82 lines (60 loc) · 2.64 KB

README.md

File metadata and controls

executable file
·
82 lines (60 loc) · 2.64 KB

BenBotAsync

Python wrapper for the BenBot API.

Downloads Requires: Python 3.x BenBot Version: 1.0.1

NOTICE:

On the 30th of July 2022, the Ben Bot API shut down, with this message from the developer, FabianFG;
It was an honor to help so many people with an idea that initially seemed nearly impossible to realize but turned into something pretty cool. Now I just don't feel like I have the time or dedication to continue properly supporting it so this will be the official end of BenBot.
Therefore with BenBot shutting down, this wrapper is now useless. Now, an alternative I would recommend is Fortnite-API which has almost all of the features that BenBot had. I have made a wrapper for this API as well with similar functions, the name of that package is FortniteAPIAsync (https://pypi.org/project/FortniteAPIAsync/).

Installing:

Synchronous: Deprecated, use the async version.

Windows: py -3 -m pip install BenBot
Linux/macOS: python3 -m pip install BenBot

Asynchronous:

Windows: py -3 -m pip install BenBotAsync
Linux/macOS: python3 -m pip install BenBotAsync

Examples:

import BenBotAsync
import asyncio


async def ben_search():
    result = await BenBotAsync.get_cosmetic(
        lang="en",
        searchLang="en",
        matchMethod="full",
        name="Ghoul Trooper"
    )

    print(result.id)

loop = asyncio.get_event_loop()
loop.run_until_complete(ben_search())

This would output:
CID_029_Athena_Commando_F_Halloween

fortnitepy example:

import fortnitepy
import BenBotAsync


client = fortnitepy.Client(
    auth=fortnitepy.EmailAndPasswordAuth(
        email='[email protected]',
        password='password123'
    )
)


@client.event
async def event_friend_message(message: fortnitepy.FriendMessage) -> None:
    args = message.content.split()
    split = args[1:]
    content = " ".join(split)

    if args[0] == '!skin':
        skin = await BenBotAsync.get_cosmetic(
            lang="en",
            searchLang="en",
            matchMethod="contains",
            name=content,
            backendType="AthenaCharacter"
        )

        await client.user.party.me.set_outfit(asset=skin.id)


client.run()

You can check out the documentation for BenBotAsync here.