Skip to main content

SimpleBot: Extensible bot for Delta Chat

Project description

SimpleBot

Latest Release Supported Versions Downloads 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 git+https://github.com/simplebot-org/simplebot

⚠️ 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.

Build with docker

# building image
docker build -t simplebot .
# running container with simplebot
# "/home/bot_volume" absolute path for storing bot data on host system
docker run -it -v /home/bot_volume:/root/.simplebot simplebot bash

In container bash you can do same bot running as in quick start section

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.

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

Uploaded Source

Built Distribution

simplebot-3.2.0-py3-none-any.whl (143.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simplebot-3.2.0.tar.gz
  • Upload date:
  • Size: 182.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for simplebot-3.2.0.tar.gz
Algorithm Hash digest
SHA256 28e584189f68308352c9a5d803d7bbcf446b3d87c8dafc2d80d51e569b51139e
MD5 cb292ebbe5626ac660523a8ab1f12165
BLAKE2b-256 c84757547bfdbc6a2cb6c35f5b19d75cf6c9c43b15362b4b29e021f2548361cd

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: simplebot-3.2.0-py3-none-any.whl
  • Upload date:
  • Size: 143.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for simplebot-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73cf1a36172e413868c11bbbf68bd61fde24d2974dd8c0bfe728972da3106e80
MD5 65157130f52ef3da1af5e5ea3e067019
BLAKE2b-256 8be51c9731c557dfe1f5e37043c292f4d29a573d9c39a2a2ee738975ca54b812

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