# How to set up a delta-bot in 6 steps

**URL:** <https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170>\
**Category:** Bots\
**Created:** [August 21, 2020, 12:58am UTC](https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170 "2020-08-21T00:58:35Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![adbenitez](https://forum.delta.chat/user_avatar/forum.delta.chat/adbenitez/32/2323_2.png) [@adbenitez](https://forum.delta.chat/u/adbenitez)\
**Post date:** [August 21, 2020, 12:58am UTC](https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170/1 "2020-08-21T00:58:35Z")

</div>

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):

```auto
$ ADDR='bot@example.com'
$ PASSWORD='myPassword'

```

2. Create and activate virtual environment (Optional but recommended):

```auto
$ python3 -m venv ~/.venvs/`echo $ADDR|tr "@" "_"`
$ source ~/.venvs/`echo $ADDR|tr "@" "_"`/bin/activate
$ pip3 install -U pip wheel

```

3. Install simplebot:

```auto
 $ pip3 install simplebot

```

4. Install some plugins, for example the `simplebot-echo` plugin:

```auto
 $ pip3 install simplebot-echo

```

5. Configure bot:

```auto
 $ simplebot init $ADDR "$PASSWORD"

```

6. Start the bot:

```auto
 $ simplebot -a $ADDR 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.

For a list of plugins to install in your bot check:

- [Search results · PyPI](https://pypi.org/search/?q=simplebot&o=&c=Environment+%3A%3A+Plugins)
- [simplebot · GitHub Topics · GitHub](https://github.com/topics/simplebot?q=plugin)

---

<div class="post-metadata">

**Author:** ![Andreas](https://forum.delta.chat/user_avatar/forum.delta.chat/andreas/32/2393_2.png) [@Andreas](https://forum.delta.chat/u/Andreas)\
**Post date:** [August 21, 2020, 10:32am UTC](https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170/2 "2020-08-21T10:32:32Z")

</div>

🎆🎇🎊🎉 Thanks so much! 🎉🎊🎇🎆

---

<div class="post-metadata">

**Author:** ![m1chas](https://forum.delta.chat/letter_avatar_proxy/v4/letter/m/53a042/32.png) [@m1chas](https://forum.delta.chat/u/m1chas)\
**Post date:** [November 8, 2020, 3:48pm UTC](https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170/3 "2020-11-08T15:48:07Z")

</div>

I have no idea what I’m doing wrong but I can’t run a _simplebot_ on my machine. I’m using Ubuntu 20.04 and I wanted to test _simplebot_. All I get are the following error messages. When I configure bot (step 6):

> “Traceback (most recent call last):  
> File “[…]/bin/simplebot”, line 8, in   
> sys.exit(main())  
> File “[…]/lib/python3.8/site-packages/deltabot/main.py”, line 24, in main  
> parser.main\_run(bot=bot, args=args)  
> File “[…]/lib/python3.8/site-packages/deltabot/parser.py”, line 87, in main\_run  
> res = args.subcommand\_instance.run(bot=bot, args=args, out=out)  
> File “[…]/lib/python3.8/site-packages/deltabot/builtin/cmdline.py”, line 51, in run  
> success = bot.perform\_configure\_address(args.emailaddr, args.password)  
> File “[…]/lib/python3.8/site-packages/deltabot/bot.py”, line 160, in perform\_configure\_address  
> self.account.update\_config(dict(  
> File “[…]/lib/python3.8/site-packages/deltachat/account.py”, line 155, in update\_config  
> self.set\_config(key, str(value))  
> File “[…]/lib/python3.8/site-packages/deltachat/account.py”, line 111, in set\_config  
> self.\_check\_config\_key(name)  
> File “[…]/lib/python3.8/site-packages/deltachat/account.py”, line 78, in \_check\_config\_key  
> raise KeyError(”{!r} not a valid config key, existing keys: {!r}".format(  
> KeyError: “‘bot’ not a valid config key, existing keys: [‘addr’, ‘mail\_server’, ‘mail\_user’, ‘mail\_pw’, ‘mail\_port’, ‘imap\_certificate\_checks’, ‘send\_server’, ‘send\_user’, ‘send\_pw’, ‘send\_port’, ‘smtp\_certificate\_checks’, ‘server\_flags’, ‘imap\_folder’, ‘displayname’, ‘selfstatus’, ‘selfavatar’, ‘bcc\_self’, ‘e2ee\_enabled’, ‘mdns\_enabled’, ‘inbox\_watch’, ‘sentbox\_watch’, ‘mvbox\_watch’, ‘mvbox\_move’, ‘show\_emails’, ‘media\_quality’, ‘key\_gen\_type’, ‘delete\_server\_after’, ‘delete\_device\_after’, ‘save\_mime\_headers’, ‘configured\_addr’, ‘configured\_mail\_server’, ‘configured\_mail\_user’, ‘configured\_mail\_pw’, ‘configured\_mail\_port’, ‘configured\_mail\_security’, ‘configured\_imap\_certificate\_checks’, ‘configured\_send\_server’, ‘configured\_send\_user’, ‘configured\_send\_pw’, ‘configured\_send\_port’, ‘configured\_smtp\_certificate\_checks’, ‘configured\_server\_flags’, ‘configured\_send\_security’, ‘configured\_e2ee\_enabled’, ‘configured\_inbox\_folder’, ‘configured\_mvbox\_folder’, ‘configured\_sentbox\_folder’, ‘configured’, ‘sys.version’, ‘sys.msgsize\_max\_recommended’, ‘sys.config\_keys’, ‘notify\_about\_wrong\_pw’, ‘basic\_web\_rtc\_instance’]”

And later when I start the bot (step 7):

> FAIL: account not configured: [full path]/account.db

Btw, I’m using a Mail-In-A-Box instance to run my email but I don’t think it matters here.

---

<div class="post-metadata">

**Author:** ![Simon](https://forum.delta.chat/user_avatar/forum.delta.chat/simon/32/287_2.png) [@Simon](https://forum.delta.chat/u/Simon)\
**Post date:** [November 8, 2020, 10:15pm UTC](https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170/4 "2020-11-08T22:15:13Z")

</div>

> [@m1chas](#):
>
> KeyError: “‘bot’ not a valid config key, existing keys

You are using an old core, change the dependency to use a core version \>= 1.47

---

<div class="post-metadata">

**Author:** ![adbenitez](https://forum.delta.chat/user_avatar/forum.delta.chat/adbenitez/32/2323_2.png) [@adbenitez](https://forum.delta.chat/u/adbenitez)\
**Post date:** [November 9, 2020, 1:44am UTC](https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170/5 "2020-11-09T01:44:58Z")

</div>

as @Simon said, you are using an old version of the `deltachat` package, run step 3 again, the ‘bot’ configuration was added recently to indicate the account is a bot (it might be used in the future to advertise the account as a bot and show nice “bot” indicators in the Delta Chat clients)

I will update simplebot package to state \>=1.40.2 is requred

---

<div class="post-metadata">

**Author:** ![m1chas](https://forum.delta.chat/letter_avatar_proxy/v4/letter/m/53a042/32.png) [@m1chas](https://forum.delta.chat/u/m1chas)\
**Post date:** [November 9, 2020, 10:43am UTC](https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170/6 "2020-11-09T10:43:52Z")

</div>

Just did that, but the error is still there. Perhaps the files up on [https://m.devpi.net/dc/master](https://m.devpi.net/dc/master) are out-of-date?

---

<div class="post-metadata">

**Author:** ![adbenitez](https://forum.delta.chat/user_avatar/forum.delta.chat/adbenitez/32/2323_2.png) [@adbenitez](https://forum.delta.chat/u/adbenitez)\
**Post date:** [November 12, 2020, 1:43am UTC](https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170/7 "2020-11-12T01:43:38Z")

</div>

I just configured a new bot some minutes ago without any issue, got deltachat-1.40.2 installed from [https://m.devpi.net/dc/master](https://m.devpi.net/dc/master),  
this smells a lot to a weird issue that happened to me once, try this first:  
`pip install -U pip`

then you can go with:  
`pip install --pre -U -i https://m.devpi.net/dc/master deltachat`

---

<div class="post-metadata">

**Author:** ![adbenitez](https://forum.delta.chat/user_avatar/forum.delta.chat/adbenitez/32/2323_2.png) [@adbenitez](https://forum.delta.chat/u/adbenitez)\
**Post date:** [November 12, 2020, 1:46am UTC](https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170/8 "2020-11-12T01:46:44Z")

</div>

> [@adbenitez](#):
>
> pip install --pre -U -i [dc/master index](https://m.devpi.net/dc/master) deltachat

ahhh maybe it is the `--pre` option!

---

<div class="post-metadata">

**Author:** ![m1chas](https://forum.delta.chat/letter_avatar_proxy/v4/letter/m/53a042/32.png) [@m1chas](https://forum.delta.chat/u/m1chas)\
**Post date:** [November 12, 2020, 10:58am UTC](https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170/9 "2020-11-12T10:58:59Z")

</div>

> [@adbenitez](#):
>
> ahhh maybe it is the `--pre` option!

Yup, that’s it. Now I managed to start the bot. Thank you!

---

<div class="post-metadata">

**Author:** ![adbenitez](https://forum.delta.chat/user_avatar/forum.delta.chat/adbenitez/32/2323_2.png) [@adbenitez](https://forum.delta.chat/u/adbenitez)\
**Post date:** [November 12, 2020, 11:01am UTC](https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170/10 "2020-11-12T11:01:28Z")

</div>

great! 🎉  
btw, a bit late by now but: welcome to the forum!

---

<div class="post-metadata">

**Author:** ![m1chas](https://forum.delta.chat/letter_avatar_proxy/v4/letter/m/53a042/32.png) [@m1chas](https://forum.delta.chat/u/m1chas)\
**Post date:** [November 12, 2020, 11:03am UTC](https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170/11 "2020-11-12T11:03:16Z")

</div>

Thanks again. Great to be here 🖖🏻

---

<div class="post-metadata">

**Author:** ![Axe](https://forum.delta.chat/user_avatar/forum.delta.chat/axe/32/1527_2.png) [@Axe](https://forum.delta.chat/u/Axe)\
**Post date:** [August 26, 2022, 3:35pm UTC](https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170/12 "2022-08-26T15:35:25Z")

</div>

OK. I really want to create my own bots for some functions I would like to perform through Delta. But I’m really having problems understanding the steps (not a programmer,) so …

I tried @adbenitez deployment at Heroku here: [GitHub - adbenitez/simplebot-www-heroku: SimpleBot Heroku deployment for a web browsing and file downloader bot](https://github.com/adbenitez/simplebot-www-heroku)

I created an email through my Yunohost setup and deployed it as per the instructions as I understood them. However, there is no response from the bot. (I can see my /help emails being sent, but nothing comes back.) Assuming I’m really _simple_, what should I do next?

My thinking is that if I can learn and understand through the work that someone else has done, that eventually I’ll be able to set up and program my own.

Thanks All!

---

<div class="post-metadata">

**Author:** ![adbenitez](https://forum.delta.chat/user_avatar/forum.delta.chat/adbenitez/32/2323_2.png) [@adbenitez](https://forum.delta.chat/u/adbenitez)\
**Post date:** [September 15, 2022, 5:15am UTC](https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170/13 "2022-09-15T05:15:41Z")

</div>

hi @axe heroku has a section where it shows the logs of the running program, there you can check if the bot received the message or had issues to connect to your server, but other people had setup the bot using the heroku deployment with a gmail account so my guess is that your email server requires some custom configuration and then automatic configuration fails in the bot, or otherwise issues to connect to your server from heroku, the logs in heroku should clarify what is going on.

btw, notice that Heroku will stop providing service for free soon, so it is not worthy, better to setup on your own hardware or VPS

---

<div class="post-metadata">

**Author:** ![Seth](https://forum.delta.chat/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@Seth](https://forum.delta.chat/u/Seth)\
**Post date:** [November 27, 2023, 9:46pm UTC](https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170/14 "2023-11-27T21:46:09Z")

</div>

I’m stuck on the last command of step 2. Fails with error:

`'ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.'`

Running gentoo loonix. Any troubleshooting suggestions?

UPDATE: I figured it out. Changed the setting in this file: `.venvs/user_domain.tld/pyvenv.cfg`

to read: `-include-system-site-packages = true`

---

<div class="post-metadata">

**Author:** ![Seth](https://forum.delta.chat/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@Seth](https://forum.delta.chat/u/Seth)\
**Post date:** [November 27, 2023, 9:55pm UTC](https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170/15 "2023-11-27T21:55:00Z")

</div>

OK, it’s failing now with this error:

```auto
$ simplebot --stdlog debug init $ADDR "$PASSWORD"
2023-11-27 13:57:56,965 - simplebot - DEBUG - registering plugin 'commands'
2023-11-27 13:57:56,965 - simplebot - DEBUG - registering plugin 'filters'
2023-11-27 13:57:56,982 - simplebot - DEBUG - registering plugin 'db'
2023-11-27 13:57:56,982 - simplebot - DEBUG - registered new command '/sub'
2023-11-27 13:57:56,982 - simplebot - DEBUG - registered new command '/unsub'
2023-11-27 13:57:56,983 - simplebot - DEBUG - registered new command '/help'
2023-11-27 13:57:56,983 - simplebot - DEBUG - registered new command '/unban'
2023-11-27 13:57:56,983 - simplebot - DEBUG - registered new command '/ban'
2023-11-27 13:57:56,983 - simplebot - DEBUG - registered new command '/set'
2023-11-27 13:57:56,983 - simplebot - DEBUG - registered new command '/echo'
2023-11-27 13:57:56,983 - simplebot - DEBUG - registered new filter 'simplebot_echo.echo_filter'
2023-11-27 13:58:58,034 - simplebot - INFO - Successfully configured bot@domain.tld
Traceback (most recent call last):
  File "/home/user/.local/bin/simplebot", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/user/.local/lib/python3.11/site-packages/simplebot/main.py", line 24, in main
    parser.main_run(bot=bot, args=args)
  File "/home/user/.local/lib/python3.11/site-packages/simplebot/parser.py", line 111, in main_run
    res = args.subcommand_instance.run(**kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/lib/python3.11/site-packages/simplebot/builtin/cmdline.py", line 152, in run
    success = bot.perform_configure_address(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/lib/python3.11/site-packages/simplebot/bot.py", line 383, in perform_configure_address
    with self.account.temp_plugin(tracker) as configtracker:
  File "/usr/lib/python3.11/contextlib.py", line 144, in __exit__
    next(self.gen)
  File "/home/user/.local/lib/python3.11/site-packages/deltachat/account.py", line 671, in temp_plugin
    self._pm.unregister(plugin)
  File "/usr/lib/python3.11/site-packages/pluggy/_manager.py", line 206, in unregister
    assert name is not None, "plugin is not registered"
           ^^^^^^^^^^^^^^^^
AssertionError: plugin is not registered

```

---

<div class="post-metadata">

**Author:** ![adbenitez](https://forum.delta.chat/user_avatar/forum.delta.chat/adbenitez/32/2323_2.png) [@adbenitez](https://forum.delta.chat/u/adbenitez)\
**Post date:** [March 28, 2024, 10:09am UTC](https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170/16 "2024-03-28T10:09:33Z")

</div>

hello @Seth sorry the late reply, I fixed the issue, read more about how to update your simplebot to include the fix here:

> <https://github.com/simplebot-org/simplebot/issues/144#issuecomment-2024827854>
>
> I'm following the guide posted in the Delta Chat support forum \[here\](https://su…pport.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170/1).
> 
> After attempting to initialize the bot it fails with the "AssertionError: plugin is not registered" traceback.
> 
> I have reproduced this issue on gentoo, guix and ubuntu systems which have the latest updates.
> 
> \`\`\`
> $ simplebot --stdlog debug init $ADDR "$PASSWORD"
> 2023-11-27 13:57:56,965 - simplebot - DEBUG - registering plugin 'commands'
> 2023-11-27 13:57:56,965 - simplebot - DEBUG - registering plugin 'filters'
> 2023-11-27 13:57:56,982 - simplebot - DEBUG - registering plugin 'db'
> 2023-11-27 13:57:56,982 - simplebot - DEBUG - registered new command '/sub'
> 2023-11-27 13:57:56,982 - simplebot - DEBUG - registered new command '/unsub'
> 2023-11-27 13:57:56,983 - simplebot - DEBUG - registered new command '/help'
> 2023-11-27 13:57:56,983 - simplebot - DEBUG - registered new command '/unban'
> 2023-11-27 13:57:56,983 - simplebot - DEBUG - registered new command '/ban'
> 2023-11-27 13:57:56,983 - simplebot - DEBUG - registered new command '/set'
> 2023-11-27 13:57:56,983 - simplebot - DEBUG - registered new command '/echo'
> 2023-11-27 13:57:56,983 - simplebot - DEBUG - registered new filter 'simplebot\_echo.echo\_filter'
> 2023-11-27 13:58:58,034 - simplebot - INFO - Successfully configured bot@domain.tld
> Traceback (most recent call last):
> File "/home/user/.local/bin/simplebot", line 8, in \<module\>
> sys.exit(main())
> ^^^^^^
> File "/home/user/.local/lib/python3.11/site-packages/simplebot/main.py", line 24, in main
> parser.main\_run(bot=bot, args=args)
> File "/home/user/.local/lib/python3.11/site-packages/simplebot/parser.py", line 111, in main\_run
> res = args.subcommand\_instance.run(\*\*kwargs)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/home/user/.local/lib/python3.11/site-packages/simplebot/builtin/cmdline.py", line 152, in run
> success = bot.perform\_configure\_address(
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/home/user/.local/lib/python3.11/site-packages/simplebot/bot.py", line 383, in perform\_configure\_address
> with self.account.temp\_plugin(tracker) as configtracker:
> File "/usr/lib/python3.11/contextlib.py", line 144, in \_\_exit\_\_
> next(self.gen)
> File "/home/user/.local/lib/python3.11/site-packages/deltachat/account.py", line 671, in temp\_plugin
> self.\_pm.unregister(plugin)
> File "/usr/lib/python3.11/site-packages/pluggy/\_manager.py", line 206, in unregister
> assert name is not None, "plugin is not registered"
> ^^^^^^^^^^^^^^^^
> AssertionError: plugin is not registered
> \`\`\`

---

<div class="post-metadata">

**Author:** ![Seth](https://forum.delta.chat/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@Seth](https://forum.delta.chat/u/Seth)\
**Post date:** [April 4, 2024, 1:16am UTC](https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170/17 "2024-04-04T01:16:43Z")

</div>

I just setup a fresh environment with the latest version of simplebot and it’s working now. Successfully tested the simplebot-echo plugin, thank you.

---

<div class="post-metadata">

**Author:** ![khk0d3](https://forum.delta.chat/letter_avatar_proxy/v4/letter/k/3be4f8/32.png) [@khk0d3](https://forum.delta.chat/u/khk0d3)\
**Post date:** [June 16, 2025, 8:28pm UTC](https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170/18 "2025-06-16T20:28:45Z")

</div>

Trying install all for bot (Debian 12 with already python3)  
after any command:

~$ pip install deltachat-rpc-server  
error: externally-managed-environment

× This environment is externally managed  
╰─\> To install Python packages system-wide, try apt install  
python3-xyz, where xyz is the package you are trying to  
install.

```
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.

See /usr/share/doc/python3.11/README.venv for more information.

```

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.  
hint: See PEP 668 for the detailed specification.

and this: $ pip3 install simplebot  
and this: pip3 install simplebot-echo  
Always warning!!!

---

<div class="post-metadata">

**Author:** ![r10s](https://forum.delta.chat/user_avatar/forum.delta.chat/r10s/32/1513_2.png) [@r10s](https://forum.delta.chat/u/r10s)\
**Post date:** [October 6, 2026, 3:19pm UTC](https://forum.delta.chat/t/how-to-set-up-a-delta-bot-in-6-steps/1170/20 "2026-10-06T15:19:26Z")

</div>


