33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
"""Telegram module router factory."""
|
|
|
|
from fastapi import APIRouter
|
|
|
|
|
|
def create_telegram_router() -> APIRouter:
|
|
"""
|
|
Create and configure Telegram module router.
|
|
|
|
Includes all Telegram bot internal API endpoints:
|
|
- /auth/verify-user - Verify Telegram user authentication
|
|
- /auth/generate-code - Generate auth code for linking
|
|
- /auth/verify-code - Verify auth code
|
|
- /stats - Bot database statistics
|
|
|
|
Returns:
|
|
APIRouter: Configured router for Telegram module
|
|
"""
|
|
router = APIRouter()
|
|
|
|
# Import routers here to avoid circular imports
|
|
from .auth_codes import router as auth_codes_router
|
|
from .internal_api import internal_api as internal_api_router
|
|
|
|
# Include all sub-routers (no prefix - already prefixed in main.py with /api/telegram)
|
|
# Auth codes router provides /auth/* endpoints
|
|
router.include_router(auth_codes_router, tags=["telegram-auth"])
|
|
|
|
# Internal API router provides additional endpoints like /stats
|
|
router.include_router(internal_api_router, tags=["telegram-internal"])
|
|
|
|
return router
|