Documentation Telegram Connector

Telegram Connector

The Telegram integration lets you control your MQTT broker and interact with BunkerAI through a Telegram bot. Chat with the bot to check broker status, query topics, manage clients, and receive anomaly alerts - from your phone, anywhere.

Prerequisites

  • BunkerAI Cloud account with available credits
  • BunkerM instance with BunkerAI Cloud connected (Settings > Integrations)
  • A Telegram account

Step 1: Create a Telegram Bot via BotFather

  1. Open Telegram and search for @BotFather (the official Telegram bot manager).
  2. Start a conversation and send /newbot.
  3. Enter a display name for your bot (e.g., "My BunkerM Bot").
  4. Enter a username for your bot - must end in bot (e.g., mybunkerm_bot).
  5. BotFather gives you a bot token that looks like:
1234567890:ABCdefGHIjklMNOpqrSTUvwxYZ
Keep your bot token secret. Anyone with this token can control your bot.

Step 2: Connect the Bot in BunkerM

  1. Go to Settings > Integrations in the BunkerM dashboard.
  2. Find the Telegram Bot section.
  3. Paste your bot token into the field.
  4. Click Connect.

BunkerM verifies the token and links the bot to your BunkerAI instance. The section shows a connected status with your bot's username.

Step 3: Start Chatting

  1. Open Telegram and search for your bot by username.
  2. Click Start or send /start.
  3. Try: "What is my broker status?"

What You Can Do via Telegram

Broker status

Show me the broker status.
How many clients are connected?
What is the current message rate?

Client queries

List all online clients.
When did sensor-kitchen-01 last connect?
Show me all clients that connected in the last hour.

Topic queries

What is the latest value on sensor/kitchen/temperature?
Show me all active topics under home/.
Which topics are receiving messages right now?

ACL management

Create a client called new-device with password pass123.
Disable client compromised-device.
Add client sensor-01 to the sensors group.

Anomaly queries

Are there any anomalies I should know about?
Show me critical anomalies from today.
Summarize the last 24 hours.

Receiving Anomaly Alerts

To get anomaly alerts forwarded to Telegram:

  1. Go to Settings > Integrations.
  2. Make sure the Telegram bot is connected.
  3. Enable Alert Forwarding.

BunkerAI will now send anomaly messages directly to your Telegram conversation.

Shared Memory

Conversation history is shared across Telegram, Slack, and Web Chat. Start a conversation on Telegram and continue it in Web Chat without losing context. See Shared AI Memory for details.

Disconnecting

Go to Settings > Integrations, find the Telegram Bot section, and click Disconnect. Your broker and AI features continue working normally - only the Telegram channel is removed.