bwb
Project description
bwb
bot with bot.
Usage
Install with pip install --upgrade bwb
.
# Import one of:
from bwb.tanner import bwb
from bwb.jason import bwb
from bwb.tdev import bwb
from bwb.molly import bwb
Handshaking
On boot up, send 000000handshake
to BWB chat.
When you see a 000000handshake
:
secret = bwb.init()
await client.send_message(BWB, '000000handshake ' + secret)
When you see a 000000handshake [secret data]
:
bwb.init(secret_data)
await client.send_message(BWB, bwb.wrap('🤝'))
When you see and authed '🤝', reply with unauthed '🤝'.
Interaction
Run every incoming message through bwb.parse()
since it's inexpensive. This will decrypt and remove base58 encoding. If the command is invalid, text
will be None
.
Example:
if text.startswith('!'):
...
else:
authed, text = bwb.parse(text)
if not text: return
Use bwb.wrap()
to auth and encode outgoing commands.
Params:
wrap(text, target=None, b58=False, enc=False)
Examples:
out = bwb.wrap('ping') # broadcast all bots
out = bwb.wrap('ping', target=TANNER) # auth for Tannerbot
out = bwb.wrap('ping', target=JASON, enc=True) # base58 encrypt
out = bwb.wrap('ping', target=MOLLY, b58=True) # base58
Development
Setup
Clone the repo.
To test your changes:
pip install --upgrade ~/path/to/bwb
Deployment
Install setuptools:
python3 -m pip install --user --upgrade setuptools wheel
- Increment version number in
setup.py
Build and upload:
bash build-upload.sh
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bwb-1.0.6.tar.gz
(3.1 kB
view details)
Built Distribution
bwb-1.0.6-py3-none-any.whl
(4.0 kB
view details)
File details
Details for the file bwb-1.0.6.tar.gz
.
File metadata
- Download URL: bwb-1.0.6.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41e93ee68e815ffc1065d868ddc5fa38c0bcfb6697cc2faa4a409c7c8ccadf77 |
|
MD5 | 7a4971c4dbe81064ff1d5da3df18be99 |
|
BLAKE2b-256 | 18b01588f1c368cbbdb561517c81ca718ae756ac37dbd9de39d9cdb9b4b69668 |
File details
Details for the file bwb-1.0.6-py3-none-any.whl
.
File metadata
- Download URL: bwb-1.0.6-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4596bd35917e6aaceeb4f49e01d4a0e0d041c38d06bc179b9cbb97ad30671cda |
|
MD5 | dc41208a9322387c86235be4851ec586 |
|
BLAKE2b-256 | 85d9ee60ba5bbc381494430b604dd9d88e39a975957948e1d121c08cd52e1def |