mirror of
https://github.com/marcogll/telegram_new_socias.git
synced 2026-01-13 13:15:16 +00:00
first commit
This commit is contained in:
54
main.py
Normal file
54
main.py
Normal file
@@ -0,0 +1,54 @@
|
||||
import os
|
||||
import logging
|
||||
from dotenv import load_dotenv
|
||||
from telegram import Update
|
||||
from telegram.constants import ParseMode
|
||||
from telegram.ext import Application, Defaults, CommandHandler, ContextTypes
|
||||
|
||||
# --- IMPORTAR HABILIDADES ---
|
||||
from modules.onboarding import onboarding_handler
|
||||
from modules.printer import print_handler
|
||||
from modules.rh_requests import vacaciones_handler, permiso_handler
|
||||
# from modules.finder import finder_handler (Si lo creas después)
|
||||
|
||||
load_dotenv()
|
||||
TOKEN = os.getenv("TELEGRAM_TOKEN")
|
||||
|
||||
logging.basicConfig(format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO)
|
||||
|
||||
async def menu_principal(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||
"""Muestra el menú de opciones de Vanessa"""
|
||||
texto = (
|
||||
"👩💼 **Hola, soy Vanessa. ¿En qué puedo ayudarte hoy?**\n\n"
|
||||
"📝 `/welcome` - Iniciar onboarding/contrato\n"
|
||||
"🖨️ `/print` - Imprimir o enviar archivo\n"
|
||||
"🌴 `/vacaciones` - Solicitar días libres\n"
|
||||
"⏱️ `/permiso` - Solicitar permiso por horas\n"
|
||||
"🔍 `/socia_finder` - Buscar datos de una compañera\n\n"
|
||||
"Selecciona un comando para empezar."
|
||||
)
|
||||
await update.message.reply_text(texto)
|
||||
|
||||
def main():
|
||||
# Configuración Global
|
||||
defaults = Defaults(parse_mode=ParseMode.MARKDOWN)
|
||||
app = Application.builder().token(TOKEN).defaults(defaults).build()
|
||||
|
||||
# --- REGISTRO DE HABILIDADES ---
|
||||
|
||||
# 1. Comando de Ayuda / Menú
|
||||
app.add_handler(CommandHandler("start", menu_principal))
|
||||
app.add_handler(CommandHandler("help", menu_principal))
|
||||
|
||||
# 2. Habilidades Complejas (Conversaciones)
|
||||
app.add_handler(onboarding_handler)
|
||||
app.add_handler(print_handler)
|
||||
app.add_handler(vacaciones_handler)
|
||||
app.add_handler(permiso_handler)
|
||||
# app.add_handler(finder_handler)
|
||||
|
||||
print("🧠 Vanessa Bot Brain iniciada y lista para trabajar en todos los módulos.")
|
||||
app.run_polling()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user