Skip to content

cuducos/bot-na-lista

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bot na Lista

Bot na Lista bot (Portuguese word play for add to the list) made with 💜 by Cuducos and Flávia.

Send a message or add @bot_na_lista_bot to a group to get started.

Comando Descrição
<string> Adiciona <string> à lista de compras
<number> Remove ítem número <number> da lista de compras
/view Mostra a lista de compras

Environment Variables

Variable Description
DATABASE_URL Credentials for a PostgreSQL database
TELOXIDE_TOKEN Telegram bot token
PORT Bot webhook port (optional)
HOST Bot webhook host (optional)

If the environment variables PORT and HOST are set, the bot starts as a webhook. Otherwise, it starts as a polling bot.

Database

If you need a quick database for development, ./contrib/db.sh starts a Docker container with one at postgres://bot:lista@0.0.0.0:5432/bot_na_lista?sslmode=disable.

If you need one for tests, ./contrib/db.sh --test starts a Docker container with no data persistence at the same URI.

To stop the database use docker stop bot-na-lista-db.

Contributing

$ cargo fmt
$ cargo clippy --fix
$ cargo test -- --test-threads 1