How to set up a delta-bot in 7 steps

Do you want to set up your own DeltaChat bot??? It is really easy, read on.

Requisites:

  • An email account for the bot.
  • GNU/Linux 64bit machine (can be installed in other systems but you will need to compile DeltaChat’s core yourself but that isn’t covered in this tutorial)
  • 500MB of RAM or more (a bot with few users use less than 100MB of RAM)
  • Python >=3.6

Steps:

  1. Declare bot address and password (Optional just to make this tutorial easier):
    $ ADDR='bot@example.com'
    $ PASSWORD='myPassword'
    
  2. Create and activate virtual environment (Optional but recommended):
    $ python3 -m venv ~/.venvs/`echo $ADDR|tr "@" "_"`
    $ source ~/.venvs/`echo $ADDR|tr "@" "_"`/bin/activate
    $ pip3 install -U pip wheel
    
  3. Install deltachat’s python bindings:
    $ pip3 install -U -i https://m.devpi.net/dc/master deltachat
    
  4. Install simplebot:
     $ git clone https://github.com/simplebot-inc/simplebot
     $ pip3 install ./simplebot
    
  5. Install some plugins:
     $ git clone https://github.com/simplebot-inc/simplebot_plugins
     $ python3 simplebot_plugins/scripts/install_plugin.py
    
  6. Configure bot:
     $ simplebot --basedir ~/bots/`echo $ADDR|tr "@" "_"` init $ADDR "$PASSWORD"
    
  7. Start the bot:
     $ simplebot --basedir ~/bots/`echo $ADDR|tr "@" "_"` serve
    

And that is all, now your have your very own delta-bot! go to your DeltaChat app and write a message: /help to your bot’s address to check it is working!

It is very cheap to run a bot, so you can repeat this steps in the same machine with another email account and have several bots, I recommend to have 250-500MB of RAM per bot if it will be a public bot.

4 Likes

:fireworks::sparkler::confetti_ball::tada: Thanks so much! :tada::confetti_ball::sparkler::fireworks:

1 Like