Skip to content

Telegram bot that allows you to find out your daily nutrient intake and keep track of their consumption

Notifications You must be signed in to change notification settings

nn-students-2021h2/Food_Bot_Team_11

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Team 11 — FoodBot

A personal Telegram assistant for those who want to have a balanced diet 🍲

Contributors

Alexey Ershov @BadRedSL — Team Leader
Daria Malikova @damalikova — QA
Nikita Chekmarev @IamLimeCake — Code Reviewer

Project Status

Project is: in progress


Table of Contents

What FoodBot can do?

  • count user's daily amount of nutrients needed based on their physiological characteristics (e.g. age, sex, physical activity level etc.)
  • collect data on user's meals, namely portion size, calorific value, proteins/fats/carbs amount
  • edit user's personal data and make nutrients recount according to changes
  • provide daily, weekly, and monthly statistics of nutrient intake
  • send daily info about nutrient intake

How to use FoodBot? Setup

For personal use

Find FoodBot in Telegram and start a conversation with the \start command:

pic

For creating your own bot

Requirements:

  • Python 3.9+
  • PyMySQL
  • python-telegram-api
  1. Clone the Food_bot_Team_11 repository.
  2. Create Telegram bot following Telegram documentation.
  3. Save your token into TOKEN variable at token.json. Make sure the file is stored one level above your project, so it won't be available on GitHub.
  4. Install MySQL and start a connection.
  5. Enjoy!

How to use FoodBot? Supported commands

  • \start — begins acquaintance with a user, i.e. collects their personal information needed for nutrients count. If the user already exists, the bot deletes their personal information and meal database.
  • \go — provides the main menu:
    • Внести прием пищи aka Add meal
    • Вспомнить свою норму КБЖУ aka Get nutrients norm
    • Получить статистику aka Get statistics
    • Изменить персональные данные aka Edit personal data
    • Удалить запись о последнем приеме пищи aka Delete the last meal info
  • \help — provides the list of available commands.

Project Structure

The project contains the following modules:

module description
foodbot.py bot main file
handlers.py bot handlers
foodbot_filters.py custom filter class for user input check. Takes state as an argument for a specific filter activation
user_class.py class for user instance creating, their nutrients count, adding to user_database, and getting statistics
meal_class.py class for meal instance creating, adding to meal_database, and calculating nutrients norm for various time spans
user_database.py database for all bot users
user_meal_database.py database for users' meals (unique for each user)
learned_dish_database.py database containing a list of unique dishes added by users

Room for Improvement

  • Implement a database with various dishes (like this one), from which nutrient facts will be taken (so that user doesn't need to enter the facts themselves)
  • Implement asynchronous database support
  • to be defined

Acknowledgements

About

Telegram bot that allows you to find out your daily nutrient intake and keep track of their consumption

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages