telegram-assistant

command module
v0.0.0-...-7171961 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 7 Imported by: 0

README

telegram-assistant

Build status Coverage

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

  1. Install and run PostgreSQL
  2. Create a user, password, and database
  3. 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>
  1. 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. image

Listing and adding items
image

Updating and showing items
image image

Deleting items
image

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL