How to build a Telegram bot messaging automation using Make?
Tags: ai, api, chatbot, make
Published: 2023-08-11 08:40:37

_In this step-by-step tutorial, we'll show you how to build an automation tool that generates text content, converts it into audio and sends it in Telegram. If you're looking to integrate other features into your app, we suggest reading Make's article on [5 ready-to-use AI solutions to build and optimize AI projects.](https://www.make.com/en/blog/ai-and-automation?referral=how-to-build-a-telegram-bot-messaging-automation-using-make)_

‍

## **Build AI on Make with Eden AI**
Eden AI was created for no-coders having difficulties with choosing the right AI provider and/or integrating several APIs. Managing multiple accounts for each app can be a tough job, but with Eden AI, you can connect and manage all your APIs on a single account.

Since some AI providers can be complex to use, we wanted to simplify the “no code” part and make AI available to as many people as possible. 

‍

Eden AI allows you to solve multiple AI tasks on Make:

- [Document parsing](https://www.edenai.co/feature/custom-document-parsing?referral=how-to-build-a-telegram-bot-messaging-automation-using-make) : extracting text from images and [parsing invoice](https://www.edenai.co/feature/ocr-invoice-parsing-apis?referral=how-to-build-a-telegram-bot-messaging-automation-using-make), [receipt](https://www.edenai.co/feature/ocr-receipt-parsing-apis?referral=how-to-build-a-telegram-bot-messaging-automation-using-make) or resume to extract data
- [Computer vision](https://www.edenai.co/feature/object-detection-apis): detect [faces](https://www.edenai.co/feature/face-detection-apis), [objects](https://www.edenai.co/feature/object-detection-apis), logos, [explicit content](https://www.edenai.co/feature/explicit-content-detection-apis), etc.
- Text analysis : [sentiment analysis](https://www.edenai.co/feature/sentiment-analysis-apis), [keyword extraction](https://www.edenai.co/feature/keyword-extraction-apis), [summarization](https://www.edenai.co/feature/summarization-apis), etc.
- [Machine Translation](https://www.edenai.co/post/best-machine-translation-apis?referral=how-to-build-a-telegram-bot-messaging-automation-using-make)
- [Speech recognition](https://www.edenai.co/post/which-speech-recognition-api-to-choose-for-your-project?referral=how-to-build-a-telegram-bot-messaging-automation-using-make) & Speech generation


## **How to generate speeches with ChatGPT & Eden AI ?**
If you're looking for an easier and faster way to implement Text-to-Speech to your workflow, skip the tutorial and watch the video below, or simply access Make text-to-speech template.

{% embed https://www.loom.com/share/7918a771634a45b4a183a0dcfac82101?sid=739f735a-0b9f-48bc-85e1-7256a089c193 %}

‍

‍

**1. Create a basic trigger**
First, to initiate your scenario you’ll need the basic trigger module from Tools. Configure it with your prompt as shown below: 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t65epo6b3duxpdl3an23.png)


The basic trigger is suitable for ad hoc automation, as it allows the workflow to be launched manually.

Nevertheless, you can connect the source where your prompts are stored (like Airtable or Google Sheets) to trigger the workflow. The prompt can also be sent by someone through Telegram, Whatsapp or any other channel.

‍

**2. Connect ChatGPT from the OpenAI module**
In this scenario, adding the Create a Prompt Completion module from OpenAI to your workflow will allow you to create compelling and large texts from a short description.

To do so, first connect to your OpenAI account, then copy-paste your API key and add it in Make:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k0gz6fqo0ku3gw4lg6c4.png)


‍

Next, configure it with one of the available model as “text-davinci-003” and enter your basic trigger prompt:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vuxyrp71qqq36vx2yfvt.png)


‍

You can also use Eden AI Generate Text module to use OpenAI, Google or Cohere completion and access all three at the same place:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uv5e74nhsd5a8c747d2s.png)


‍

Don't have an account on Eden AI yet? No worries, we're giving away $10 credits when you register:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6dvaus7jtdbhp9sjal8y.png)

[**Get your API key for FREE**](https://app.edenai.run/user/register?referral=how-to-build-a-telegram-bot-messaging-automation-using-make)
‍


**3. Connect your Text-to-Speech API key**
Once you're sure that OpenAI will create a text that fits with your needs, you can connect the Eden AI Convert Text to Speech module to process your text:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yv70eowrbjbb9l6yv5np.png)
‍

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/prmpzzl4jhauguylrypk.png)



‍

**4. Set up your Text-to-Speech module**
Once the connection is set, the configuration of the Eden AI Text-to-Speech module is very easy.

First, you will need to enter the text generated by OpenAI in the text input, then choose the text-to-speech engine you want to use along with the language and the voice option:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p1w4p0qdnqcc9y7o99n9.png)


‍

As you can see, the Eden AI module allows you to choose the best text-to-speech providers by checking their prices and live testing their performances directly on the [Eden AI platform](https://app.edenai.run/user/register?referral=how-to-build-a-telegram-bot-messaging-automation-using-make).

As soon as the Eden AI text-to-speech module is set, you will be able to send audio files on Telegram!

‍

**5. Set up your Telegram Bot**
Now, add the Telegram Bot Send an Audio File module:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fb6dwea70hdmnb12rvv5.png)


Last but not least, configure your Telegram bot.

Download Telegram and create an account. To create your bot, we suggest to follow this step-by step tutorial : 

{% youtube aNmRNjME6mE  %}
‍

Once your bot has been set up, you have to create a new channel and add your bot as an admin in this channel.

‍

Then, there are two parameters to enter in Make. The first one is the token you'll need to enter in order to add a new connection in Make: 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nwb2cmuj6tregiha27tc.png)


‍

You can find it in the conversation with BotFather (cf. Telegram tutorial) when you created your bot:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f0k4blmjcfsp8amb69oh.png)


The second parameter you need to set up is the link of your channel which you can find in the BotFather conversation parameters: 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zd9zdamq46ovdqxthrhv.png)


‍

Type it as follows:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gbbsrbmb9cvij4qxnviy.png)


‍

Eventually, you'll need to select the audio file you want to send through along with its format. Here, you have two possibilities. You can either send the audio file using data :


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/swgawnsf0hng3km2ztya.png)


‍

Or by HTTP URL : 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tf0pqwt5t1p2fpa9h71c.png)


‍

At this stage, your module is ready to run. So, you can add a description in the “Caption” field: 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/090qdf4doj0e8b30h370.png)


‍

and run your scenario to receive your first audio file:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/raak7vtpta6rkwa2rgez.png)


‍

Congrats! You're all set and ready to automate your text-to-speech processing with Make! You can now adapt and customize this scenario to create powerful AI assistants!

‍

If you're interested in more low-code tools, have a look at our step-by-step tutorials on how to bring AI to your application with [Power Apps](https://www.edenai.co/post/a-step-by-step-guide-to-integrating-edenai-invoice-parser-on-microsoft-powerapps?referral=how-to-build-a-telegram-bot-messaging-automation-using-make), [Google App Script](https://www.edenai.co/post/a-step-by-step-guide-to-integrating-ai-in-your-app-with-google-app-script?referral=how-to-build-a-telegram-bot-messaging-automation-using-make), [Retool](https://www.edenai.co/post/a-step-by-step-guide-to-implementing-ai-in-your-app-using-retool?referral=how-to-build-a-telegram-bot-messaging-automation-using-make), [IFTTT](https://www.edenai.co/post/a-step-by-step-guide-to-implementing-ai-in-your-app-using-ifttt?referral=how-to-build-a-telegram-bot-messaging-automation-using-make), and [n8n](https://www.edenai.co/post/a-step-by-step-guide-to-implementing-ai-in-your-app-with-n8n?referral=how-to-build-a-telegram-bot-messaging-automation-using-make).

[**Create your Account on Eden AI**](https://app.edenai.run/user/register?referral=how-to-build-a-telegram-bot-messaging-automation-using-make)