Skip to content

Latest commit

 

History

History

python_deltabot_plugin

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Python DeltaBot Plugin

This example is about creating a plugin for deltabot, a pluggable deltachat bot.

There are 2 alternative options available:

Usage

Setup deltabot

You need python 3.7 for this to work. (Newer versions could work, but this example was tested to work with this version, feel free to upgrade the example and drop us a pull request)

# Optional create virtualenv
pip install virtualenv
virtualenv .venv
source .venv/bin/activate
pip3 install -U pip wheel

# install deltachat
pip3 install --pre -U -i https://m.devpi.net/dc/master deltachat # see https://github.com/deltachat/deltachat-core-rust/tree/master/python if it doesn't work for instructions on how to install it from source)

# Install deltabot
pip install git+https://github.com/deltachat-bot/deltabot.git@ae298b414d0ed6b5ffbfcca466375f60e3a5b4b9 attrs

# init the bot (either set the env vars or replace them with the email credentials the bot should use)
deltabot --basedir=.data init $ADDR "$PASSWORD"

Install the module/plugin

In deltabot you install python modules like this:

deltabot --basedir=.data add-module ./path/to/module.py

This folder contains two examples:

  • echo.py - The clasic echo all text messages
  • echo_command.py - An /echo [text] command

So the commands are the following:

deltabot --basedir=.data add-module echo.py
deltabot --basedir=.data add-module echo_command.py

To start type:

deltabot --basedir=.data serve

Reference links