telegram-assistant
A telegram bot that allows users to manage their inventory - items and recipes. Initially made to prevent food stored in the far reaches of my kitchen cabinet and fridge from going to waste.
Running the Server Locally
- Install and run PostgreSQL
- Create a user, password, and database
- Set the values for the environment variables or simply enter the commands below in the terminal:
export POSTGRES_HOST=<postgres_host>
export POSTGRES_PORT=<postgres_port>
export POSTGRES_USER=<user>
export POSTGRES_PASS=<password>
export POSTGRES_DB=<postgres_db>
export BOT_TOKEN=<telegram-bot-token>
- Run the server with
make run
Commands
/start - List the available commands
/listitems - List items in your inventory
/listitems sort by <field> asc - List items in your inventory in ascending order
/listitems sort by <field> desc - List items in your inventory in descending order
/listitems filter by <field> = <text> - List filtered items in your inventory (operations can be =, >, <, >=, <=, <>)
/showitem - Show prompt for entering the item to be shown
/showitem <item> - Show an item's details
/additem - Show prompt for entering the item to be added
/additem <item> - Add an item to your inventory
/updateitem - Show prompt for entering the item to be updated
/updateitem <item> <field> <value> - Update an item in your inventory
/deleteitem - Show prompt for entering the item to be deleted
/deleteitem <item> - Delete an item in your inventory
/importitems - Import records from a CSV file
Usage
Adding the bot to a chat for the first time will present you with a START button. Upon clicking it, the Menu button will become available and clicking it will show a list of commands accepted by the bot.
Listing and adding items
Updating and showing items
Deleting items