| deltachat-core-rust@e34687ba42 | ||
| src | ||
| .dir-locals.el | ||
| .envrc | ||
| .gitignore | ||
| .gitmodules | ||
| Cargo.lock | ||
| Cargo.toml | ||
| channels-lock.scm | ||
| channels.scm | ||
| config.yaml | ||
| delta-fastbot.yaml | ||
| docker-compose.yaml | ||
| guix.scm | ||
| LICENSE | ||
| Makefile | ||
| manifest.scm | ||
| README.md | ||
Delta Fastbot
Delta Fastbot is a generic and extensible bot for Delta Chat, designed to be easily configurable through a YAML file. Its goal is to act as a flexible automation layer between Delta Chat and external systems.
Features
- The bot can send messages to any configured Delta Chat conversation (private chats and groups)
- All target chats are defined by providing the Delta Chat QR text in the configuration
- Support for JSON webhooks with fully customizable message formatting defined in the YAML configuration
- PostgreSQL hooks for database events:
- INSERT, UPDATE, DELETE, and TRUNCATE events
- Selection of custom columns from affected rows
- Message composition using templates written directly in the YAML configuration
- Admin chat interface, the
!helpcommand will list available commands - Custom commands that can send chat data to a url, using a POST request
Configuration
The bot is configured using a single YAML file, you can find a reference YAML in the delta-fastbot.yaml file.
The configuration defines:
- Enabled integrations
- Webhook behavior
- Database event subscriptions
- Mapping between events and Delta Chat conversations
- Custom commands
Usage
Delta Fastbot requires a single environment variable to run: DELTA_FASTBOT_CONFIG, this variable must contain the path to the YAML configuration file. If it is not set, the bot will default to: ./delta-fastbot.yaml
On startup, Delta Fastbot prints a Delta Chat QR link that can be used to start a private conversation with the bot.
During the first startup, the bot also generates a one-time admin token and prints a message that must be sent to the bot to register the first administrator. This token is valid only once and is automatically invalidated after the first usage.
After at least one administrator has been registered, additional admin tokens can be generated by existing admins using the chat command !new_admin_token.
Logging
If you want to enable logs, the recommended environment variable is the one already used in the project direnv:
RUST_LOG=pgp=error,deltachat=error,rustls=error,debug
This setup keeps noisy dependencies quiet while preserving useful debug output for the bot itself.
Running the bot
If Delta Fastbot has been installed via Guix, you can simply run the delta-fastbot commands.
From inside the project directory, you can start it using Cargo:
cargo run --release
Build
The development environment is defined declaratively in manifest.scm, using Guix.
The most convenient method to access the development environment is to use direnv on the host machine.
With direnv installed and enabled in your shell, the project directory will automatically load the Guix environment described in manifest.scm upon entry, and unload it when leaving the directory. This avoids running guix shell ... manually each time.
Without direnv, to manually enter in the development environment:
guix time-machine -C channels-lock.scm -- shell -m manifest.scm
Whenever the dependencies change, you can update the development shell with:
make update-env
To build the bot, run:
cargo build --release
Or, to directly use the Guix packaging system:
guix build -L . delta-fastbot
To build the OCI image, you can simply run:
make build-container
When the build finishes you will notice a path /gnu/store/...-delta-fastbot-docker-pack.tar.gz in the command output. You can load it with
docker load << PATH
Where PATH is the path you found in the output.
Roadmap
Planned features:
- RSS feed registration and periodic updates
- In-chat configuration directly from Delta Chat
- Creation and management of broadcast channels
- API monitor that watches a JSON endpoint and sends notifications when updates are detected
- Per-user configuration
- Expose directly as a Guix System service
License
Delta Fastbot is released under the GNU General Public License (GPL). See the LICENSE file for full details.