Files
talia_bot/app/modules/print.py
google-labs-jules[bot] 490f55bfcf feat: Add /print command for authorized users
This commit introduces a new `/print` command that is restricted to authorized users.

The main changes are:
- Created `app/modules/print.py` to house the handler for the new command.
- The handler uses the existing `is_admin` function from `app/permissions.py` to check for authorization.
- Integrated the new command into `app/main.py`.
- Updated `tasks.md` to document the new feature.
2025-12-15 23:31:39 +00:00

14 lines
507 B
Python

# app/modules/print.py
from telegram import Update
from telegram.ext import ContextTypes
from app.permissions import is_admin
async def print_handler(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
"""Handles the /print command."""
chat_id = update.effective_chat.id
if is_admin(chat_id):
await update.message.reply_text("This is a restricted command for authorized users.")
else:
await update.message.reply_text("You are not authorized to use this command.")