Files
duty-teller/handlers/commands.py
Nikolay Tatarinov d90d3d1177 Add initial project structure for Telegram bot
- Created Docker configuration files for development and production.
- Added Dockerfile for building the bot image.
- Implemented configuration loading from environment variables.
- Developed main application logic and command handlers.
- Included README with setup instructions and usage details.
- Added .gitignore and .dockerignore files to exclude unnecessary files.
- Provided example environment file (.env.example) for bot token configuration.
- Established basic error handling for the bot.
2026-02-17 12:16:47 +03:00

22 lines
716 B
Python

"""Command handlers: /start, /help (and placeholder for more)."""
from telegram import Update
from telegram.ext import CommandHandler, ContextTypes
async def start(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
if update.message:
await update.message.reply_text("Hello! I'm your bot. Use /help to see available commands.")
async def help_cmd(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
if update.message:
await update.message.reply_text(
"Available commands:\n"
"/start - Start the bot\n"
"/help - Show this help"
)
start_handler = CommandHandler("start", start)
help_handler = CommandHandler("help", help_cmd)