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, 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, handle_data=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 prompt_toolkit.eventloop.defaults import use_asyncio_event_loop
from prompt_toolkit.patch_stdout import patch_stdout

from intercept import Client, DataFormat, MessageEvent

use_asyncio_event_loop()

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


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


@client.event
async def event_ready():
    while client.handler._do_loop:  # pylint: disable=protected-access
        with patch_stdout():
            text = await prompt(" >> ", async_=True)

        if text == "quit":
            client.stop()
        else:
            await client.command(text)
    print("Done running")


client.run(backend='asyncio')

More examples can be found here

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.1.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distributions

intercept.py-0.1.0-py3.7.egg (14.6 kB view details)

Uploaded Source

intercept.py-0.1.0-py3.6.egg (14.5 kB view details)

Uploaded Source

intercept.py-0.1.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file intercept.py-0.1.0.tar.gz.

File metadata

  • Download URL: intercept.py-0.1.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for intercept.py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 75af72498c06cf495ed840a4f89d11a014dd84f0381eb020b16f12e81be71ff3
MD5 4d985211c0c37d79258d17a90ca4887f
BLAKE2b-256 c00ddd0a637e337de478b25d50aa92d011e725e3a404331a84283c92550fb89f

See more details on using hashes here.

File details

Details for the file intercept.py-0.1.0-py3.7.egg.

File metadata

  • Download URL: intercept.py-0.1.0-py3.7.egg
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for intercept.py-0.1.0-py3.7.egg
Algorithm Hash digest
SHA256 849795e7ca38e228600d04d5df94146f6576a44be1c44afad59ce984c331c2e5
MD5 3c91256c2a2638baf2531c28aae2337c
BLAKE2b-256 9dcb513664110934dbc7de0dc8d7e74f854a37c4db27a590d3b042b7a53f2d21

See more details on using hashes here.

File details

Details for the file intercept.py-0.1.0-py3.6.egg.

File metadata

  • Download URL: intercept.py-0.1.0-py3.6.egg
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for intercept.py-0.1.0-py3.6.egg
Algorithm Hash digest
SHA256 305e8e4e4f38530621d7b4b8d5deae6789ff54db14460d3ec53feed0338a1886
MD5 243beed34e3a20dcbf663b264f35f51b
BLAKE2b-256 0efa28c6586e38f826548945ecb8481237718ec903832d5c9adbfbf25feb1d48

See more details on using hashes here.

File details

Details for the file intercept.py-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: intercept.py-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for intercept.py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0da3f16a5d407432f764899b0b853fc549e5dbfbc11fd70c3419c7eb986362e
MD5 4879dd0492f6f639b2425acf438a5b6a
BLAKE2b-256 1aada2c00e95abd6c893bf1dc5f14df5c6d66be81717cf24ce82a0c30ab6fdb3

See more details on using hashes here.

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