How to build a myBrain bot in Telegram without code (using Make)

We will guide you through the process of creating a Telegram bot that answers questions using myBrain, all made without code.

Published on:

Do not index
Do not index
Are you looking to build a myBrain bot that can answer questions in Telegram without writing a single line of code? Look no further! In this step-by-step guide, we'll walk you through how to create your own Telegram bot that uses ChatGPT to answer your questions with AI.

Step 1: Set up a new bot in Telegram

First, open Telegram and search for the "BotFather" bot. Type "/start" and follow the instructions to create a new bot. Be sure to name your bot something that ends with "bot".

Step 2: Get your API token

After creating your bot, the BotFather will provide you with an API token. Copy and store this token for later use.

Step 3: Build a flow

Next, create a flow that includes a Telegram bot watching for updates, an HTTP request to the myBrain webhook, and a text message to send the response back to the user.

Step 4: Connect your Telegram bot to the flow

In the "Watch Updates" block, add a connection and paste the API token you obtained earlier from the BotFather.

Step 5: Make an HTTP request to myBrain

Create a POST request using the URL and request content provided by myBrain. To find this information, go to myBrain’s "Embed and Integrate" section and click on "API Access". Make sure the headers, body type, and content type match what is shown in the video.

Step 6: Replace the placeholder with message text

In the body of the HTTP request, replace "insert your question" with the message text coming from Telegram. You can simply drag the "Message.Text" field from Telegram into the appropriate spot.

Step 7: Parse the JSON response

To display a shorter message in your Telegram bot, first parse the JSON response from myBrain. In the "JSON.String" field, insert the data from the HTTP request.

Step 8: Send the message back to the user

Finally, use the "SendMessage" block to send the parsed answer back to the user. Insert the chat ID and the parsed answer, leaving some space for reference links.

Step 9: Add a filter to prevent a message being sent on your first ‘reply’

After your Telegram “Watch updates” bot add a filter with the condition 1. Messages: Text and choose: “Text operators: Does not contain” then enter “/start” into the text field. This will ensure that a reply isn’t triggered when the bot initiates.

Step 10: Test your bot

Click "Run once" and wait for new data. Then, go to your bot in Telegram and type a question. For example, you can ask: "What is your returns policy?"

Step 11: Receive the answer

After sending the question, the webhook will process your request and send the answer back to your Telegram bot. The response will include the answer along with any references.

Step 12: Customize the response (optional)

If you want to shorten the answer or change the answer style, you can do so by going to myBrain and customizing the response settings.
With these steps, you should now have a fully functional myBrain bot in Telegram that uses ChatGPT to answer your questions with AI. Remember that this integration is currently limited to the "Explain" function and does not support the conversational chat feature.
Enjoy using your new bot!

Join other 3200+ marketers now!

Ready to take the next big step for your business?