Happ Docs

Telegram

Connect your AI assistant to Telegram

Overview

Telegram is the most popular channel on Happ. Unlike most platforms that use simple webhook-based bots, Happ connects via MTProto (GramJS) with persistent session strings, giving full Telegram client capabilities.

Setup

Step 1: Connect to Happ

  1. Go to Integrations > Add Integration > Telegram
  2. Enter your phone number associated with your Telegram account
  3. Complete the authentication (verification code or QR code)
  4. If you have 2FA enabled, enter your password when prompted
  5. Assign an AI assistant
  6. Click Connect

Step 2: Test

Send a message to the connected account. Your AI assistant should respond.

Authentication Methods

MethodDescription
Phone + CodeEnter phone number, receive verification code via Telegram
QR CodeScan QR code from Telegram desktop/mobile (supports 2FA)

WebSocket events during QR authentication:

  • TELEGRAM_QR_CODE_UPDATED — New QR code to display
  • TELEGRAM_QR_AUTH_NEEDS_2FA — 2FA password required
  • TELEGRAM_QR_AUTH_COMPLETED — Successfully authenticated

Features

Private Chats

The bot handles one-on-one conversations. Each user gets their own conversation thread.

Group Chats

Your bot can be added to Telegram groups and respond when mentioned or replied to directly.

Supported Message Types

  • Text messages
  • Images and photos
  • Voice messages
  • Documents and files
  • Stickers
  • Video messages

Non-text messages appear as placeholders in the AI context (e.g., [User sent a photo]).

Telegram Push Notifications

Separately from the main integration, set up Telegram Push Notifications to alert your team when the AI hands off a conversation or when specific events occur.

Tips

  • Bot description: Set a clear description in BotFather so users know what the bot does
  • Commands: Configure commands (/start, /help) in BotFather
  • Profile picture: Add a professional profile picture
  • Privacy mode: Disable in BotFather if you want the bot to see all group messages
  • /bot command: Users can send /bot in a chat to toggle AI mode on/off