Table of contents:
Telegram follows the tail of instant messaging applications despite all the functions it hides. Most people don't know that on Telegram you can create your own stickers and even your own bots.
One of the most famous bots has been «@Polibot», who has accompanied us during all these months prior to the last elections . But not only Polibot has become famous, others like «@VKM_bot» or «Youtube Bot» have also made our lives easier by being able to select music and videos according to our personal requests.
Well, going back to the possibility offered by Telegram of creating our own bots, we are going to tell you, step by step, how you can do it yourself .
Steps to create our own Bot
The first thing we will do is open the application of Telegram You can do it on Android, iOS or on the desktop version. We will mention the bot that will help us manage the process, @BoTFather Next we will type /start and send it to you. This is how we started the creation process.
Then the assistant will send us a message with all the commands that we can use to manage the process of creating our bot.
Now type / newbot and start the creation process. The first thing it will ask us is a name, we have called ours "Yourexpert" Act followed by asking us for his username, the alias with which we can add him to be able to interact with him. Should always end in bot , so we have named ours “Yourexpertobot”. A Once we have given it the alias, it will reply confirming that we have already created our bot and with it it will send us a tokken with which we will access the bots' API.
We can now take advantage and using the commands that @BotFather has given us, we can customize the bot . For example, by sending « / setuserpic”, we can change the image of our bot. We can also add our own commands to the bot using /setcommands. We just have to follow the instructions of "@Fatherbot".
Programming the bot
Well, we've already created our bot, but now what we need is for it to do things, right? To program the bot the steps will be as follows:
We will use the API pyTelegramBotAPI going to https://c9.io/. We register and verify the mail. Once we have verified the account we will have to create a new workspace in “Create a new workspace”.
Now, in the tab that says “bash” we will write the following: “sudo pip install pyTelegramBotAPI» and we should get this:
This screen tells us that the API to program the bot is already installed and ready to be used.
Now to program the bot through this API we will use the phyton language Don't worry if you don't know nothing about phyton, the programming of the bots is very simple, here we leave you a tutorial so that you can step by step get your bot to do what you want it to do.