Skip to main content

Python library for intercept, a game by bubmet

Project description

Intercept.py

Python library for intercept, a game by bubmet

Styled after discord.py (async), this library aims to give users a customizable experience with the game.

Examples

Chat logger:

from intercept import Client, DataFormat, ChatEvent

client = Client(username, password, fmt=DataFormat.CLEAN)

@client.event
async def event_chat(event: ChatEvent):
    print(event.msg)

client.run()

Simple custom client using prompt-toolkit:

from prompt_toolkit import prompt
from intercept import Client, DataFormat, MessageEvent

client = Client(username, password, fmt=DataFormat.ANSI)

@client.event
async def on_event(event):
    if isinstance(event, MessageEvent):
        print(event.msg)

@client.event
async def event_ready():
    while client._do_loop:  # pylint: disable=protected-access
        text = await prompt(" >> ", async_=True)
        if text == "quit":
            client.stop()
        else:
            await client.command(text)

client.run(backend='asyncio')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

intercept.py-0.0.2.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distributions

intercept.py-0.0.2-py3.7.egg (13.9 kB view hashes)

Uploaded Source

intercept.py-0.0.2-py3-none-any.whl (7.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page