# Telegram Bridge — EQUIPITELLO :8095

## Variables (.env bridge)

```env
TELEGRAM_BRIDGE_BOT_TOKEN=...        # @BotFather
TELEGRAM_BRIDGE_ALLOWED_IDS=123456   # tu chat id
TELEGRAM_BRIDGE_POLLING=true         # lab sin HTTPS
# TELEGRAM_WEBHOOK_URL=              # https://xxx.ts.net/api/telegram/bridge
# TELEGRAM_WEBHOOK_SECRET=           # opcional (header Telegram)
```

**Verificar:** `GET /api/telegram/status` (auth bridge) → `@botusername listo`

## Menús inline

`/start` y `/help` muestran teclado inline: Status, Hub, Mirror, Vault, comandos `run:*`.

## Modo polling (sin HTTPS)

Con `TELEGRAM_BRIDGE_POLLING=true`, long-polling al arrancar bridge.
Reinicia: `cursor-bridge-manager.ps1 -Restart`

## Webhook HTTPS (Tailscale Funnel)

```powershell
cd C:\xampp\htdocs\cursor-mobile-bridge
.\tools\setup-telegram-funnel.ps1
.\cursor-bridge-manager.ps1 -Restart
```

Luego registrar webhook:

```http
POST http://127.0.0.1:8095/api/telegram/setup-webhook
X-Bridge-Token: <BRIDGE_TOKEN>
```

Pon `TELEGRAM_BRIDGE_POLLING=false` cuando el webhook esté activo.

## Evolution WhatsApp (.16)

```powershell
.\tools\deploy-evolution-server16.ps1
```

RDP → `http://100.69.11.89:8080/manager` → QR

## Auditoría migración

Ver `docs/AUDITORIA_EQUIPITELLO_VS_SERVER_16.md`

## Seguridad

- No commitear token en git
- Rotar token si se expuso en chat/logs
