LifeBrain is a Telegram productivity assistant built using python-telegram-bot.
It helps users with calculations, weather updates, news, task reminders, and simple natural chat without paid AI APIs.
This project is designed to be:
- Free and offline-friendly
- Easy to run locally
- Suitable for academic projects
- Safe for public GitHub sharing
- Solve math expressions
- Get weather by city
- Fetch latest news
- Add, view, and delete tasks
- Task reminders
- Daily summary
- Simple natural replies (rule-based, no OpenAI)
bot/
├── main.py
├── requirements.txt
├── .env.example
├── utils/
│ ├── solver.py
│ ├── translator.py
│ ├── weather.py
│ ├── news.py
│ ├── db.py
│ ├── memory.py
│ └── daily_summary.py
- Python 3.10 or 3.11
- Telegram account
git clone https://github.com/ramkumar27072006/LifeBrain-tele-bot.git
cd LifeBrain-tele-botpython -m venv venvWindows:
venv\Scripts\activateLinux/macOS:
source venv/bin/activatepip install -r requirements.txt- Open Telegram
- Search for @BotFather
- Run:
/start
/newbot
- Copy your bot token.
TELEGRAM_BOT_TOKEN=PASTE_YOUR_BOT_TOKEN_HERENever upload your .env file to GitHub.
python main.py| Command | Description |
|---|---|
| /start | Start the bot |
| /help | Show help menu |
| /solve 25*(4/3) | Solve math expression |
| /weather chennai | Get weather |
| /news ai | Get news |
| /addtask drink water 14:00 | Add task |
| /showtasks | View tasks |
| /deletetask | Delete a task |
| /daily 07:00 | Daily summary |
You can also type normal messages for simple chat replies.
Render free services automatically sleep after inactivity, causing Telegram bots to stop responding.
For a free always-on solution, PythonAnywhere is recommended.
Wrap your polling logic in a restart loop:
import time
import logging
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO
)
def main():
while True:
try:
print('LifeBrain Bot is starting...')
except Exception as e:
logging.error(f'Bot crashed with error: {e}. Restarting in 15 seconds...')
time.sleep(15)
if __name__ == '__main__':
main()git clone https://github.com/ramkumar27072006/LifeBrain-tele-bot.git
cd LifeBrain-tele-bot
pip install --user python-telegram-botnohup python main.py &Check running processes:
ps uxView logs:
cat nohup.outhttps://t.me/YourBotUsername
- No OpenAI or paid APIs used
- Bot must run locally or on a server
- Best tested on Python 3.10 and 3.11
Ramkumar R
B.Tech AI & Data Science
This project is open-source and intended for educational use.