Skip to main content

SimpleBot: Extensible bot for Delta Chat

Project description

SimpleBot

GitHub release (latest) Supported Versions Downloads GitHub license CI Code style: black Contributors

An extensible Delta Chat bot.

Install

To install the latest stable version of SimpleBot run the following command (preferably in a virtual environment):

pip install simplebot

To test unreleased version:

pip install --pre -U -i https://m.devpi.net/dc/master deltachat
pip install https://github.com/simplebot-org/simplebot/archive/master.zip

⚠️ NOTE: If Delta Chat Python bindings package is not available for your platform you will need to compile and install the bindings manually, check deltachat documentation for more info.

Quick Start: Running a bot+plugins

(Replace variables $ADDR and $PASSWORD with the email and password for the account the bot will use)

  1. Add an account to the bot:

    simplebot init "$ADDR" "$PASSWORD"
    
  2. Install some plugins:

    pip install simplebot-echo
    
  3. Start the bot:

    simplebot serve
    

Plugins

SimpleBot is a base bot that relies on plugins to add functionality, for official plugins check simplebot_plugins

Everyone can publish their own plugins, search in PyPI to discover cool SimpleBot plugins

⚠️ NOTE: Plugins installed as Python packages (for example with pip) are global to all accounts you register in the bot, to separate plugins per account you need to run each account in its own virtual environment.

Creating per account plugins

If you know how to code in Python, you can quickly create plugins and install them to tweak your bot.

Lets create an "echo bot", create a file named echo.py and write inside:

import simplebot

@simplebot.filter
def echo(message, replies):
""" Echoes back received message."""
    replies.add(text=message.text)

That is it! you have created a plugin that will transform simplebot in an "echo bot" that will echo back any text message you send to it. Now tell simplebot to register your plugin:

simplebot plugin --add ./echo.py

Now you can start the bot and write to it from Delta Chat app to see your new bot in action.

Check the examples folder to see some examples about how to create plugins.

Note for users

SimpleBot uses Autocrypt end-to-end encryption but note that the operator of the bot service can look into messages that are sent to it.

Credits

SimpleBot is based on deltabot

SimpleBot logo was created by Cuban designer "Dann".

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

simplebot-1.1.0.tar.gz (135.1 kB view details)

Uploaded Source

Built Distribution

simplebot-1.1.0-py3-none-any.whl (138.4 kB view details)

Uploaded Python 3

File details

Details for the file simplebot-1.1.0.tar.gz.

File metadata

  • Download URL: simplebot-1.1.0.tar.gz
  • Upload date:
  • Size: 135.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for simplebot-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d30fce18c1fb4750dfa3e228ee3b0063aa35848f768bd6f64a121da7581cba67
MD5 fb8a4c698dc8c06035f222153b50d905
BLAKE2b-256 7fad60c4c01ba0232f18a1f33813e601b7f30778a442ef1a03ef645d1f7b1e64

See more details on using hashes here.

Provenance

File details

Details for the file simplebot-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: simplebot-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 138.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for simplebot-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1105ae6dab63ef3ef2fc07cfedac2ef70e3d8025ef9e541d9f6aa8695f993eff
MD5 93a4a8cd8aa386519303924c36d5d13b
BLAKE2b-256 a1c1c4ffa45c5e3f20b87493e2523858846b21ed335039e9a417f11459e984e0

See more details on using hashes here.

Provenance

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