header
login

How to Create a Telegram Bot

In this guide, you'll create a Telegram bot that greets users and responds to commands. It takes about 10 minutes.

Prerequisites

  • A TheQueue account
  • A Telegram account

Step 1: Create a Bot in Telegram

  1. Open @BotFather in Telegram
  2. Send /newbot
  3. Enter a display name (e.g., "My Helper")
  4. Enter a username (must end with bot, e.g., my_helper_bot)
  5. Copy the token — you'll need it next

Step 2: Create a Project in TheQueue

  1. Log in to your dashboard
  2. Click "Create Project"
  3. Enter a name and click "Create"
  4. The project opens in the visual editor

Step 3: Add a Telegram Trigger

  1. Right-click on an empty canvas area
  2. Select Triggers → Telegram
  3. Double-click the trigger block
  4. Paste the bot token in the bot_api field

Step 4: Add Logic

Right-click → Functions → Step. Inside the step, add:

/start Condition

Right-click → Functions → if:

"{=message=}" == "/start"

Welcome Message

In the then branch, add send_message:

Hello, {=tgData.from.first_name=}! I'm your helper bot.

Available commands:
/help — help
/info — information

Default Response

In the else branch, add send_message:

You wrote: {=message=}
Type /help for a list of commands.

Step 5: Save and Test

  1. Press Ctrl+S to save
  2. Open your bot in Telegram
  3. Send /start — the bot will respond with a greeting
  4. Send any text — the bot will respond with the default message

What's Next

  • Add buttons for easy navigation
  • Connect AI for smart responses
  • Set up a multi-step dialog for data collection
  • Integrate with CRM for sales automation