Skip to content

Telegram Integration ​

Communicate with your customers via Telegram using the Telegram Bot API.

Requirements ​

For Telegram integration:

  • Telegram account
  • Bot token obtained from BotFather

Creating a Bot ​

1. Creating a Bot with BotFather ​

  1. Search for @BotFather on Telegram
  2. Send the /newbot command
  3. Enter a name for the bot
  4. Set a username for the bot (must end with bot)
  5. Copy the provided API Token

2. Connecting to DOLU.ai ​

  1. Go to Settings > Channels > Telegram
  2. Click the Connect Telegram button
  3. Paste the token obtained from BotFather
  4. Click the Connect button

Bot Settings ​

Profile Settings ​

Edit the bot profile with BotFather:

  • /setdescription - Bot description
  • /setabouttext - About text
  • /setuserpic - Profile photo
  • /setcommands - Available commands

Commands ​

You can define commands for the bot:

start - Start the chat
help - Get help
menu - Main menu
info - Get information

Message Types ​

Supported Content ​

TypeSendReceive
TextYesYes
ImageYesYes
VideoYesYes
AudioYesYes
DocumentYesYes
LocationYesYes
ContactYesYes
StickerNoYes

Inline Buttons ​

Add clickable buttons to messages:

json
{
  "inline_keyboard": [
    [
      {"text": "Place Order", "callback_data": "order"},
      {"text": "Support", "callback_data": "support"}
    ],
    [
      {"text": "Website", "url": "https://dolu.ai"}
    ]
  ]
}

Reply Keyboard ​

Present options to the user:

json
{
  "keyboard": [
    ["Order Tracking", "New Order"],
    ["Help", "Contact"]
  ],
  "resize_keyboard": true
}

Group and Channel Support ​

Group Messages ​

You can add the bot to groups:

  1. Add the bot to the group
  2. Grant admin permissions
  3. View group messages in the Inbox

Channel Management ​

Manage your Telegram channels:

  • Broadcast to the channel
  • Read comments
  • Create polls

Automatic Replies ​

Welcome Message ​

Automatic reply to the /start command:

Hello! Welcome to the DOLU.ai Telegram Bot.

Type /menu to see the menu.
Type /help to get assistance.

AI Agent ​

The AI Agent can be active on Telegram:

  • Understands natural language questions
  • Responds from the knowledge base
  • Transfers to a human for complex topics

Notifications ​

Send notifications via Telegram:

  • Order updates
  • Appointment reminders
  • Campaign announcements

Webhooks ​

Your Telegram bot triggers these events:

  • message - New message received
  • callback_query - Button clicked
  • chat_member - Membership changed

API Usage ​

bash
# Send message
POST /api/v1/messages/telegram
{
  "chatId": "123456789",
  "message": "Hello!"
}

# Message with buttons
POST /api/v1/messages/telegram
{
  "chatId": "123456789",
  "message": "Select an option:",
  "inlineKeyboard": [
    [{"text": "Option 1", "callbackData": "opt1"}]
  ]
}

Troubleshooting ​

Bot Not Responding ​

  • Check that the token is correct
  • Make sure the webhook URL is accessible
  • Check that the bot is not blocked

Messages Are Delayed ​

  • Check webhook status
  • Check server response time

Buttons Not Working ​

  • Make sure the callback data is in the correct format
  • Make sure the bot has sufficient permissions

Best Practices ​

  1. Use commands: Guide users
  2. Add buttons: Make interaction easier
  3. Respond quickly: Users expect instant replies
  4. Notifications: Inform without spamming
  5. Manage groups: Build a community

DOLU.ai - AI-Powered CRM Platform