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.
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".
After creating your bot, the BotFather will provide you with an API token. Copy and store this token for later use.
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.
In the "Watch Updates" block, add a connection and paste the API token you obtained earlier from the BotFather.
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.
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.
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.
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.
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.
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?"
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.
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!