How to build a Telegram bot messaging automation using Make?

How to build a Telegram bot messaging automation using Make?

·

4 min read

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.

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:

How to generate speeches with ChatGPT & Eden AI?

If you're looking for an easier and faster way to implement Text-to-Speech in your workflow, skip the tutorial and watch the video below, or simply access Make text-to-speech template.

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

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

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

Image description

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

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

Image description

Get your API key for FREE

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

Image description

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

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.

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

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 :

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 to add a new connection in Make:

Image description

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

Image description

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

Type it as follows:

Image description

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

Or by HTTP URL :

Image description

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

Image description

and run your scenario to receive your first audio file:

Image description

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, Google App Script, Retool, IFTTT, and n8n.

Create your Account on Eden AI