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,16 +1,11 @@
|
||||
# app/modules/onboarding.py
|
||||
"""
|
||||
This module handles the initial interaction with the user, specifically the
|
||||
/start command.
|
||||
# Este módulo maneja la primera interacción con el usuario (el comando /start).
|
||||
# Se encarga de mostrar un menú diferente según quién sea el usuario (dueño, admin, equipo o cliente).
|
||||
|
||||
It is responsible for identifying the user's role and presenting them with a
|
||||
customized menu of options based on their permissions. This ensures that each
|
||||
user sees only the actions relevant to them.
|
||||
"""
|
||||
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
|
||||
|
||||
def get_owner_menu():
|
||||
"""Creates and returns the main menu keyboard for the 'owner' role."""
|
||||
"""Crea el menú de botones para el Dueño (Owner)."""
|
||||
keyboard = [
|
||||
[InlineKeyboardButton("📅 Ver mi agenda", callback_data='view_agenda')],
|
||||
[InlineKeyboardButton("⏳ Ver pendientes", callback_data='view_pending')],
|
||||
@@ -18,7 +13,7 @@ def get_owner_menu():
|
||||
return InlineKeyboardMarkup(keyboard)
|
||||
|
||||
def get_admin_menu():
|
||||
"""Creates and returns the main menu keyboard for the 'admin' role."""
|
||||
"""Crea el menú de botones para los Administradores."""
|
||||
keyboard = [
|
||||
[InlineKeyboardButton("📊 Ver estado del sistema", callback_data='view_system_status')],
|
||||
[InlineKeyboardButton("👥 Gestionar usuarios", callback_data='manage_users')],
|
||||
@@ -26,7 +21,7 @@ def get_admin_menu():
|
||||
return InlineKeyboardMarkup(keyboard)
|
||||
|
||||
def get_team_menu():
|
||||
"""Creates and returns the main menu keyboard for the 'team' role."""
|
||||
"""Crea el menú de botones para los Miembros del Equipo."""
|
||||
keyboard = [
|
||||
[InlineKeyboardButton("🕒 Proponer actividad", callback_data='propose_activity')],
|
||||
[InlineKeyboardButton("📄 Ver estatus de solicitudes", callback_data='view_requests_status')],
|
||||
@@ -34,7 +29,7 @@ def get_team_menu():
|
||||
return InlineKeyboardMarkup(keyboard)
|
||||
|
||||
def get_client_menu():
|
||||
"""Creates and returns the main menu keyboard for the 'client' role."""
|
||||
"""Crea el menú de botones para los Clientes externos."""
|
||||
keyboard = [
|
||||
[InlineKeyboardButton("🗓️ Agendar una cita", callback_data='schedule_appointment')],
|
||||
[InlineKeyboardButton("ℹ️ Información de servicios", callback_data='get_service_info')],
|
||||
@@ -43,20 +38,18 @@ def get_client_menu():
|
||||
|
||||
def handle_start(user_role):
|
||||
"""
|
||||
Handles the /start command by sending a role-based welcome message and menu.
|
||||
|
||||
This function acts as a router, determining which menu to display based on
|
||||
the user's role, which is passed in as an argument.
|
||||
Decide qué mensaje y qué menú mostrar según el rol del usuario.
|
||||
"""
|
||||
welcome_message = "Hola, soy Talía. ¿En qué puedo ayudarte hoy?"
|
||||
|
||||
# Dependiendo del rol, llamamos a una función de menú diferente
|
||||
if user_role == "owner":
|
||||
menu = get_owner_menu()
|
||||
elif user_role == "admin":
|
||||
menu = get_admin_menu()
|
||||
elif user_role == "team":
|
||||
menu = get_team_menu()
|
||||
else: # Default to the client menu for any other role.
|
||||
else: # Por defecto, si no es ninguno de los anteriores, es un cliente
|
||||
menu = get_client_menu()
|
||||
|
||||
return welcome_message, menu
|
||||
|
||||
Reference in New Issue
Block a user