How to use the pypresence.AioPresence function in pypresence

To help you get started, we’ve selected a few pypresence examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xMistt / fortnitepy-bot / fortnite.py View on Github external
async def start_discord_rich_presence() -> None:
    rpc = pypresence.AioPresence(
        client_id='717610574837710919',
        loop=client.loop
    )

    try:
        await rpc.connect()
    except Exception as discord_error:
        print(f'There was an error: {discord_error}.')

    start_time = datetime.datetime.now().timestamp()

    while True:
        try:
            outfit = (await BenBotAsync.get_cosmetic_from_id(
                cosmetic_id=client.party.me.outfit
            )).name