A small Telegram bot template built with python-telegram-bot. Good starting point if you want a working bot with commands, buttons, and message handling without writing everything from scratch.
- Basic commands:
/start,/help,/jump,/about,/time,/echo - Inline buttons for quick actions
- Simple keyword-based auto replies
- Per-user message stats (in memory)
- Works in private chats and groups (with mention)
- Logging + error handler
-
Clone the repo:
git clone https://github.com/yourname/TelegramFlyBot.git cd TelegramFlyBot -
Install dependencies:
pip install python-telegram-bot
-
Put your bot token in the code (or better, use an environment variable):
TOKEN = "YOUR_BOT_TOKEN"
-
Run:
python bot.py
| Command | What it does |
|---|---|
/start |
Greets you and shows buttons |
/help |
Lists all commands |
/jump |
Makes the bot jump |
/channels |
Shows recommended channels |
/stats |
Your message count |
/about |
Info about the bot |
/echo <text> |
Repeats your text |
/time |
Current server time |
handle_response()checks for keywords likehello,how are you,thanks, etc. and returns a reply.- In groups, the bot only replies when it's mentioned (
@kfspE55_bot). user_statsis a plain dict — it resets every time the bot restarts. Swap it for SQLite if you want persistence.
- The token in the code is a placeholder — replace it with your own.
- Never commit real tokens to GitHub. Use a
.envfile or environment variables.
MIT — do whatever you want with it.