![]() Here’s a video of me following the steps above. And voilà, our Telegram Trigger node is ready. Lastly, click on Execute Node on the top right of the dialog box. To do that, select the option ‘message’ for the Updates field. Add a new credential by clicking on Create New under the Credentials section of the node.Īfter that, you’ll need to configure that the node gets triggered every time a message is sent to the bot. If you forgot to copy the API token, go to the BotFather chat window and retrieve it from there. First of all, we have to add the credentials for the Telegram API and give the Telegram Trigger node access to that. Select the Telegram Trigger node under the Trigger nodes menu to create the node. ![]() In our case, it is the Telegram Trigger getting webhook data via the bot.Ĭreate the Trigger node by clicking on the ' +' button on the top right of the screen. Let us now create a Trigger node, which starts a workflow when the webhook gets some data. ![]() Type “o” in the terminal to open the Editor UI. To learn more about this, check out the documentation. We started n8n using the -tunnel parameter to be able to use webhooks trigger from Telegram as it has to be reachable from the web. In this case, once you have installed n8n, you can start it using the following command: Alternatively, install n8n using npm with the following command: You can sign-up for a free n8n cloud trial to get early access to our hosted service. To get started with creating the back-end of the bot, you’ll need access to n8n. Very well, now that we have a bot and a command, it’s time to add some functionality to the bot. Now, if you go back to the bot that you created and start typing ‘/’, it will show you the list of commands that you have prepared for the bot. Here’s a video of me setting a command for my bot. Select the bot that you just created and enter a command in the suggested format. Issue the /setcommands command and you’ll be asked to select the bot for which you want to set a command. To set a new command for our bot, go to the BotFather chat window again. However, if you plan to create more commands for the bot, later on, it might makes sense to try this on for size. You can skip this section for the tutorial, if you’d like. Let’s create a command to our bot before adding some functionality to it. Creating a bot on Telegram Adding commands to the bot Just click on the API key to copy it to the clipboard. This process created my bot, gave me the link to access it (you can also search for your bot by the username that you gave it) and the API key that I’ll need later. This has to be a unique username that has to end in ‘bot’. I named it ‘n8n bot’, cause why not? You will then be asked to choose a username for the bot. You can get a list of all the commands that you can issue with /help.įirst of all, issue the /newbot command. You can open a chat with BotFather by clicking here. We have to use the master of all bots that the team at Telegram created, aptly called BotFather. However, you can also use the web client or the mobile app for this. To create the Telegram bot, I downloaded the Telegram application for macOS. I personally used the latter on macOS, because it allows for better visibility and control. You can create a Telegram bot directly in the mobile app, on the web client or in the desktop app for your OS. Creating a Telegram trigger node on n8n. ![]() To accomplish this, we’ll go through five steps: In this tutorial, I will teach you how to create your very own Telegram weather bot with n8n (the workflow was built using ). One day it’s 6☌ and the next day, it’s 21☌ □ A good first use-case for me would be to create a bot that can send me the weather information whenever I ask for it. It’s springtime in Berlin and the weather is unpredictable. Recently, I started working with n8n, a fair-code licensed tool that helps you automate tasks, sync data between various sources and react to events all via a visual workflow editor. I have been planning to make a bot for a while and have been looking for some nice workflow tools that can help me handle the back-end workflow of the bots visually. I am a big fan of Telegram because of its great bot-ecosystem.
0 Comments
Leave a Reply. |