mirror of
https://github.com/marcogll/talia_bot.git
synced 2026-01-13 21:35:19 +00:00
Merge pull request #11 from marcogll/feat/add-print-command-8512170790091266484
Add /print command for authorized users
This commit is contained in:
@@ -102,6 +102,7 @@ def main() -> None:
|
|||||||
|
|
||||||
application.add_handler(conv_handler)
|
application.add_handler(conv_handler)
|
||||||
application.add_handler(CommandHandler("start", start))
|
application.add_handler(CommandHandler("start", start))
|
||||||
|
application.add_handler(CommandHandler("print", print_handler))
|
||||||
application.add_handler(CallbackQueryHandler(button_dispatcher))
|
application.add_handler(CallbackQueryHandler(button_dispatcher))
|
||||||
|
|
||||||
# Set up the scheduler
|
# Set up the scheduler
|
||||||
|
|||||||
13
app/modules/print.py
Normal file
13
app/modules/print.py
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# 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.")
|
||||||
5
tasks.md
5
tasks.md
@@ -26,6 +26,7 @@ This file tracks the development tasks for the Talía project.
|
|||||||
- [x] Implement `aprobaciones.py` module.
|
- [x] Implement `aprobaciones.py` module.
|
||||||
- [x] Implement `servicios.py` module.
|
- [x] Implement `servicios.py` module.
|
||||||
- [x] Implement `admin.py` module.
|
- [x] Implement `admin.py` module.
|
||||||
|
- [x] Add `/print` command for authorized users.
|
||||||
|
|
||||||
## Phase 4: Integrations
|
## Phase 4: Integrations
|
||||||
|
|
||||||
@@ -43,3 +44,7 @@ This file tracks the development tasks for the Talía project.
|
|||||||
- Implemented the `agenda` and `citas` modules.
|
- Implemented the `agenda` and `citas` modules.
|
||||||
- Implemented the conversational flow for proposing and approving activities.
|
- Implemented the conversational flow for proposing and approving activities.
|
||||||
- Completed Phase 3 by implementing all modules and refactoring the main dispatcher.
|
- Completed Phase 3 by implementing all modules and refactoring the main dispatcher.
|
||||||
|
|
||||||
|
### 2024-05-23
|
||||||
|
|
||||||
|
- Add `/print` command for authorized users.
|
||||||
|
|||||||
Reference in New Issue
Block a user