Code Monkey home page Code Monkey logo

simplebot's Introduction

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

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

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

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".

simplebot's People

Contributors

adbenitez avatar hpk42 avatar dependabot[bot] avatar 12345678aabbc avatar michel-slm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.