A telegram bot that persists the dialogs into the PostgreSQL database. The code is written with async Rust (tokio runtime) and relies on teloxide (for telegram bot API) and deadpool (for PostgreSQL communication).
The schema is versioned with Pyrseas and stored in the db.yaml file. To generate the SQL file from the YAML file, run:
createdb bot
yamltodb bot bot-core/src/db.yaml > migration.sql
psql -f migration.sql bot
cargo build --release
First export your telegram bot token:
export TELOXIDE_TOKEN=...
Then run the bot:
RUST_LOG="debug" PG_USER=$USER PG_POOL_CAPACITY=2 ./target/release/bot
You can configure the PostgreSQL connection settings with the environment variables listed in the config_from_env() function.