AutomationIntermediate

How to Build an AI Telegram Chatbot in Make.com

Connect a Telegram bot to OpenAI in Make so users can chat with an AI assistant directly in Telegram.

9 minIntermediate

You can run a working AI chatbot inside Telegram with three Make modules and no server. This guide creates a bot, sends each message to OpenAI, and replies in the same chat.

  • A Make.com account
  • A Telegram account
  • A bot token from @BotFather
  • An OpenAI API key

Step 1: Create the bot in BotFather

In Telegram open @BotFather, send the /newbot command, and follow the prompts to name your bot. BotFather returns an API token. Copy it; you will paste it into Make in the next step.

Telegram - @BotFather
$/newbot
Alright, a new bot. How are we going to call it?
$Setuproll Helper
Good. Now let's choose a username. It must end in 'bot'.
$setuproll_helper_bot
Done! Use this token to access the HTTP API:
8123456789:AAH7x...keep-this-secret
$

Step 2: Add the Telegram trigger

In a new scenario add the Telegram Bot Watch Updates module. Create a connection using your bot token. Make registers a webhook with Telegram automatically, so the bot receives messages in real time.

Step 3: Send the message to OpenAI

Add OpenAI Create a Completion (Chat). Map the incoming Telegram text into the user message. Add a system message that defines your bot's personality and scope so it stays on topic.

OpenAI system message
You are a friendly assistant for Setuproll users. Answer briefly and clearly. If a question is outside automation or no-code topics, say so politely and offer to help with something related.
Make.com - chatbot scenario
Telegram Watch Updates -> OpenAI Chat -> Telegram Send a Message
user text reply text back to chat_id

Step 4: Reply in the same chat

Add a Telegram Bot Send a Message module. For Chat ID map the chat id from the trigger so the reply goes to the right person. For Text map the OpenAI result.

Add memory later
This basic bot answers each message in isolation. To give it short term memory, store the last few exchanges in a Data Store keyed by chat id and prepend them to the prompt on the next call.

Step 5: Activate and chat

Turn on Scheduling and set the scenario to run immediately as data arrives. Open Telegram, message your bot, and you should get an AI reply within seconds.

Result: a live Telegram assistant that answers questions about your product around the clock, all running on Make with no hosting to manage.

Watch related tutorials

Tags
#make.com#telegram#chatbot#openai#webhook