Skip to main content

bwb

Project description

bwb

bot with bot.

Usage

- 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 '🤝'.

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 note 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) # encrypt
out = bwb.wrap('ping', target=MOLLY, b58=True) # base58

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

bwb-1.0.3.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

bwb-1.0.3-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file bwb-1.0.3.tar.gz.

File metadata

  • Download URL: bwb-1.0.3.tar.gz
  • Upload date:
  • Size: 2.9 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

Hashes for bwb-1.0.3.tar.gz
Algorithm Hash digest
SHA256 5f9c25298ba75ae69f2d0320feea4a05523114e3460e74af924b97f0412da9a5
MD5 877a2a5694adcf881c89b1bdc6a60177
BLAKE2b-256 1b52a27a0523deb2a7feec5a2b62537862f6c9fb7344b2c6bfbf421acaa271ac

See more details on using hashes here.

File details

Details for the file bwb-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: bwb-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.9 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

Hashes for bwb-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 548c3e333f3ab4fe74471bd23740fd24dac3d952a456b479da09c0e2769941e8
MD5 c88d01759be4b484ae12b6f5c0915c78
BLAKE2b-256 11babb514f5e772fb62a3ea446e4259912777d06528d408a227957543a1b80e5

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