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

Uploaded Source

Built Distributions

intercept.py-0.1.1-py3.7.egg (14.8 kB view details)

Uploaded Source

intercept.py-0.1.1-py3.6.egg (14.7 kB view details)

Uploaded Source

intercept.py-0.1.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: intercept.py-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 ecea21c30df9502b3a18c33b863dbb11f6dfa08aaace82f265c09900389a7484
MD5 0f2297b967a7967fddf6ac43e4a68cf6
BLAKE2b-256 71dd9a1b88a082e281edf2ea96b67e17c860629fa7bec4121a2a0f2a390dfa00

See more details on using hashes here.

File details

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

File metadata

  • Download URL: intercept.py-0.1.1-py3.7.egg
  • Upload date:
  • Size: 14.8 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.1-py3.7.egg
Algorithm Hash digest
SHA256 ac8e8d07e5c384e1a8cfab2126efa211eb8786c3d76a4ddf4318ea9c99fc677b
MD5 c85399429b1f95cf9f389d776da28565
BLAKE2b-256 8c6ed65c5cc4cde57dabe43247f34dc9c5787d9fcbdbf9226e5ea999228b6265

See more details on using hashes here.

File details

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

File metadata

  • Download URL: intercept.py-0.1.1-py3.6.egg
  • Upload date:
  • Size: 14.7 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.1-py3.6.egg
Algorithm Hash digest
SHA256 e6a54d05691b591e5feabbb6c83954373f18438f8401ff3ec68bfade28478d2a
MD5 2e937dd8261929d13e66d40b6e56e35f
BLAKE2b-256 6c79e3a1cac8699a21d0e5d184fa01f450847f9e7635f85597d001eadbc0a22d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: intercept.py-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8ea81001bdbafe46ded87daeab1ea28204c863dd17fb793223abfed67f7003df
MD5 69e631d93bc4494d8b0e12e1e1d3c058
BLAKE2b-256 5379af5a407d6af279ae4f5251eb871ed2527b34537bd904b7b419fb748872c5

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