Telegram assistent bot
- 4 Devlogs
- 18 Total hours
To learn python, I'm building a simple Telegram Bot designed to track daily health habits. The bot will allow users to quickly track their daily metrics: Sleep duration Physical activity
To learn python, I'm building a simple Telegram Bot designed to track daily health habits. The bot will allow users to quickly track their daily metrics: Sleep duration Physical activity
Hey everyone! Here’s an update on what I’ve been working on for my project over the past few days.
The biggest new feature is visual weekly statistics! Now users can see a chart/graph of their activity over the course of the week.
user_data.I decided it was time to break up my codebase into multiple modules/files:
I made several quality-of-life improvements to make the bot feel much more robust:
/start once to initialize reminders and resets).
README.md
In this update, I focused on refining the user metrics and implementing the automated weekly reset mechanism.
logger.info): Discovered how extremely valuable logger.info is for debugging scheduled jobs and tracking state transitions. Without proper logging, diagnosing automated execution bugs would have been significantly harder.Initially, I started building this bot using another library. However, I decided to rewrite the codebase using python-telegram-bot
Why? python-telegram-bot is much more practical and scalable for complex, multi-step projects. Since I plan to build bigger features in the future, I figured it was best to learn and adopt a solid framework right now. I spent about an hour migrating my previous logic to PTB, and it was definitely worth it!
I added core bot commands and integrated custom reply keyboards:
/help: Shows available commands./log: Prompts you to pick an activity via a custom reply keyboard and log your stats./analytic: Allows you to select an activity and view your current recorded progress.was figuring out how to handle sequential user inputs :
/log).context.user_data[activity] instead of adding to it. I will fix this so values accumulate properly over time.Since fixing these remaining issues won’t take too much time, I’ll soon be ready to add new features.
So let me know if you got any ideas in the comments below
This is my first Python project. Instead of just memorizing syntax from tutorials, I decided to learn the language through hands-on practice.
To test this approach, I’m building a simple Telegram Bot designed to track daily health habits.
The bot will allow users to quickly log their daily metrics:
It stores this data and, upon clicking a button, generates a weekly summary analysis to track progress.
So far, I have:
.gitignore, dependencies, configuration).This project isn’t meant to be a full-scale commercial application; it’s a personal challenge:
Can I effectively master Python by building functional, real-world projects from scratch?