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.2.0.tar.gz
(5.3 kB
view details)
Built Distributions
intercept.py-0.2.0-py3.7.egg
(14.8 kB
view details)
intercept.py-0.2.0-py3.6.egg
(14.7 kB
view details)
File details
Details for the file intercept.py-0.2.0.tar.gz
.
File metadata
- Download URL: intercept.py-0.2.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.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a943d7f980aea14ec40100707bfadcad174a90d8b676f216a7efede42798dab |
|
MD5 | 030c4599dd31a55a5f47a343cf04993e |
|
BLAKE2b-256 | 7407263199dab19e7a3d44a1bbfce90d14956cc0ef67ea539a4bf1e60e74da7b |
File details
Details for the file intercept.py-0.2.0-py3.7.egg
.
File metadata
- Download URL: intercept.py-0.2.0-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9694989bfe40935e1addcaf85f5bcc5fdd2fe8ad0a6909e040e1d5315735355 |
|
MD5 | 9c92d5892ea2e4c377349d0045d84ad3 |
|
BLAKE2b-256 | ea0aa2a9bc3e64b1489a15150403ab7eebc10a234de8594554e1981c709360f3 |
File details
Details for the file intercept.py-0.2.0-py3.6.egg
.
File metadata
- Download URL: intercept.py-0.2.0-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c8d7cf2c0dc1b2471952fb4cf4d0991fffe6b83b4eae6dcd5291db4e2368812 |
|
MD5 | 07c03d949aee18e4d362531469f117de |
|
BLAKE2b-256 | 68c4bb908d39102306ee592eb7d5bbd1abc677a1901403b275e8a2787c62e070 |
File details
Details for the file intercept.py-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: intercept.py-0.2.0-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.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 870379e9bb0f0ea635b4243e0d2f0401da6ef7e823c5c7b23232ea35c16eaa38 |
|
MD5 | fd266548331d3668c8354ec774b4b709 |
|
BLAKE2b-256 | e91bb5fc1455d1b7fc8d9216ffb5717b025c0e016b43da8140aafcb577e9b50c |