Designed for your CLI agent to take the reigns. Build your own custom Telegram bot with minimal setup. A powerful, extensible Telegram bot template with an always-listening daemon, task/goal management, and preconfigured .agent folders with SKILLs and resources for building out your own custom bots.
- ๐ค Always-Listening Daemon - Run 24/7 in the background, responding to commands instantly
- ๐ Task & Goal Management - Create, track, and complete tasks and goals from Telegram
- ๐ฅ Daily Streaks - Track productivity with streak counters
- โฐ Scheduled Alerts - Morning briefings and evening check-ins
- ๐ด Sleep/Wake Modes - Control when the bot responds
- ๐ ๏ธ Extensible Template - Easy to add your own integrations and APIs
- ๐ค Agent Skill Integration - Works with Claude, Cursor, and other AI assistants
- Python 3.8+ installed
- Telegram account for bot creation
| Credential | How to Get |
|---|---|
TELEGRAM_BOT_TOKEN |
Message @BotFather โ /newbot |
TELEGRAM_BOT_USER_ID |
Message @userinfobot |
TELEGRAM_API_ID |
Go to my.telegram.org โ API Development Tools |
TELEGRAM_API_HASH |
Go to my.telegram.org โ API Development Tools |
# Clone the repo
git clone https://github.com/shane9coy/telegram-bot-easy.git
cd telegram-bot-easy
# Install dependencies
pip install -r requirements.txt
# Create environment file
cp .env.example .env
# Edit .env with your credentials
# Create logs directory
mkdir -p logs# Start as background daemon
python telegram_listener.py --daemon
# Verify it's running
python telegram_listener.py --statusSend /help to your bot on Telegram!
Telegram/
โโโ telegram_listener.py # Core daemon (handles messages, routing)
โโโ telegram_helpers.py # Helper functions (add your services here)
โโโ templates/
โ โโโ helper_template.py # Full integration pattern reference
โโโ .kilocode/skills/
โ โโโ telegram/SKILL.md # Main skill (usage + setup)
โ โโโ telegram-builder/SKILL.md # Builder skill (dev guide)
โโโ .claude/skills/
โ โโโ telegram/SKILL.md # Synced with .kilocode version
โโโ requirements.txt
โโโ .env.example
โโโ README.md
| Command | Description |
|---|---|
/help |
Full command list |
/status |
Listener mode, pending tasks, PID |
/weather |
Current weather |
sleep / goodnight |
Enter sleep mode |
wake / good morning |
Exit sleep mode |
| Command | Description |
|---|---|
/tasks |
Today's pending tasks |
add task: <text> |
Add a new task |
done: <text> or done <#> |
Complete a task |
/goals |
Active goals |
add goal: <text> |
Add a new goal |
/progress |
Today's stats and streak |
This template is designed to be extended. Add your own services easily:
- Add helper function in
telegram_helpers.py:
def get_my_service(query=None):
"""Fetch data from your API."""
# Your implementation
return "**My Service**\nResult here"- Import in
telegram_listener.py:
from telegram_helpers import get_my_service- Add command handler in
route_command():
if lower.startswith("/myservice"):
query = text.split(maxsplit=1)[1] if len(text.split()) > 1 else None
return get_my_service(query)See templates/helper_template.py for a complete integration example with:
- API client pattern
- Error handling
- Response formatting
- User profile integration
The telegram-builder skill provides detailed guidance for AI assistants to help you build integrations.
# Check if listener is running
python telegram_listener.py --status
# Start in foreground (see logs live)
python telegram_listener.py
# Start as background daemon
python telegram_listener.py --daemon
# Stop the running listener
python telegram_listener.py --stop
# Enter sleep mode (no responses, only scheduled alerts)
python telegram_listener.py --sleep
# Wake from sleep mode
python telegram_listener.py --wake
# View logs
tail -f logs/telegram_listener.log# Required
TELEGRAM_BOT_TOKEN=123456789:ABCdefGHIjklMNOpqrsTUVwxyz
TELEGRAM_BOT_USER_ID=123456789
TELEGRAM_API_ID=12345678
TELEGRAM_API_HASH=your_api_hash_here
# Optional - add your own API keys
# MY_API_KEY=your_key_here{
"telegram": {
"chat_id": null,
"notifications_enabled": true,
"morning_brief": true,
"task_reminders": true,
"goal_checkin_time": "20:00",
"always_listening": true
},
"location": {
"name": "Your City",
"latitude": 41.4489,
"longitude": -82.708
}
}-
Check if listener is running:
python telegram_listener.py --status
-
Check logs for errors:
tail logs/telegram_listener.log
-
Verify
.envcredentials are correct
mkdir -p logs
chmod 755 logspython telegram_listener.py --stop && python telegram_listener.py --daemonIf you're an AI assistant (Claude, Cursor, etc.) helping set up this bot:
- Verify Python 3.8+ is installed
- Run
pip install -r requirements.txt - Copy
.env.exampleto.env - Guide user to get Telegram credentials
- Create logs directory:
mkdir -p logs - Start daemon:
python telegram_listener.py --daemon - Verify:
python telegram_listener.py --status - Test: Send
/helpto the bot
- telegram - Main skill for bot usage and setup
- telegram-builder - Guide for building new integrations
MIT License - see LICENSE file for details.
Built by @shaneswrld_ | GitHub