holger krekel
2020-03-25 07:48:21 +01:00
parent 57f879a6ba
commit 2a34022619
6 changed files with 56 additions and 25 deletions

View File

@@ -1,18 +1,18 @@
examples
========
Once you have :doc:`installed deltachat bindings <install>`
you need email/password credentials for an IMAP/SMTP account.
Delta Chat developers and the CI system use a special URL to create
temporary e-mail accounts on [testrun.org](https://testrun.org) for testing.
Receiving a Chat message from the command line
----------------------------------------------
Once you have :doc:`installed deltachat bindings <install>`
you can start playing from the python interpreter commandline.
Here is a simple bot that:
Here is a simple module that implements a bot that:
- receives a message and sends back an "echo" message
- receives a message and sends back ("echoes") a message
- terminates the bot if the message `/quit` is sent
@@ -23,11 +23,35 @@ With this file in your working directory you can run the bot
by specifying a database path, an e-mail address and password of
a SMTP-IMAP account::
python echo_and_quit.py --db /tmp/db --email ADDRESS --password PASSWORD
$ cd examples
$ python echo_and_quit.py /tmp/db --email ADDRESS --password PASSWORD
While this process is running you can start sending chat messages
to `ADDRESS`.
Track member additions and removals in a group
----------------------------------------------
Here is a simple bot that:
- echoes messages sent to it
- tracks if configuration completed
- tracks member additions and removals for all chat groups
.. include:: ../examples/group_tracking.py
:literal:
With this file in your working directory you can run the bot
by specifying a database path, an e-mail address and password of
a SMTP-IMAP account::
python group_tracking.py --email ADDRESS --password PASSWORD /tmp/db
When this process is running you can start sending chat messages
to `ADDRESS`.
Writing bots for real
-------------------------