mirror of
https://github.com/marcogll/talia_bot.git
synced 2026-01-13 21:35:19 +00:00
docs: Translate comments and logging messages to Spanish across various modules and the scheduler.
This commit is contained in:
@@ -1,11 +1,7 @@
|
||||
# app/modules/print.py
|
||||
"""
|
||||
This module provides a command for administrators to print out the current
|
||||
configuration details of the bot.
|
||||
# Este módulo permite a los administradores imprimir los detalles de configuración del bot.
|
||||
# Es una herramienta útil para depuración (debugging).
|
||||
|
||||
It is a debugging and administrative tool that allows authorized users to quickly
|
||||
inspect key configuration variables without accessing the environment directly.
|
||||
"""
|
||||
from telegram import Update
|
||||
from telegram.ext import ContextTypes
|
||||
from ..permissions import is_admin
|
||||
@@ -13,21 +9,22 @@ from ..config import TIMEZONE, CALENDAR_ID, N8N_WEBHOOK_URL
|
||||
|
||||
async def print_handler(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
|
||||
"""
|
||||
Handles the /print command.
|
||||
|
||||
When triggered, this function first checks if the user has admin privileges.
|
||||
If they do, it replies with a formatted message displaying the current values
|
||||
of the TIMEZONE, CALENDAR_ID, and N8N_WEBHOOK_URL configuration variables.
|
||||
If the user is not an admin, it sends a simple "not authorized" message.
|
||||
Maneja el comando /print.
|
||||
|
||||
Verifica si el usuario es administrador. Si lo es, muestra valores clave
|
||||
de la configuración (Zona horaria, ID de calendario, Webhook).
|
||||
"""
|
||||
chat_id = update.effective_chat.id
|
||||
|
||||
# Solo permitimos esto a los administradores
|
||||
if is_admin(chat_id):
|
||||
config_details = (
|
||||
f"**Configuration Details**\n"
|
||||
f"Timezone: `{TIMEZONE}`\n"
|
||||
f"Calendar ID: `{CALENDAR_ID}`\n"
|
||||
f"n8n Webhook URL: `{N8N_WEBHOOK_URL}`\n"
|
||||
f"**Detalles de Configuración**\n"
|
||||
f"Zona Horaria: `{TIMEZONE}`\n"
|
||||
f"ID de Calendario: `{CALENDAR_ID}`\n"
|
||||
f"URL Webhook n8n: `{N8N_WEBHOOK_URL}`\n"
|
||||
)
|
||||
await update.message.reply_text(config_details, parse_mode='Markdown')
|
||||
else:
|
||||
await update.message.reply_text("You are not authorized to use this command.")
|
||||
# Si no es admin, le avisamos que no tiene permiso
|
||||
await update.message.reply_text("No tienes autorización para usar este comando.")
|
||||
|
||||
Reference in New Issue
Block a user