๐Ÿค– Telegram Bot (example) v1.4

by Arena Closer

Version 5 (July 5, 2022)

Download (950 downloads)

(68 blocks)
Example of the basic blocks youโ€™d need to program your own Telegram Bot in Automate. Includes a detailed explanation of how to start.

When finished, it can run a certain sequence of blocks or a whole flow, and send the outcome back to you via Telegram.

๐—š๐—ฒ๐˜๐˜๐—ถ๐—ป๐—ด ๐˜€๐˜๐—ฎ๐—ฟ๐˜๐—ฒ๐—ฑ
1. Create a bot in t.me/BotFather and obtain your bot token
2. Run the flow and paste your new bot token in the dialog
3. Send "/start" to your bot
4. The bot should reply with your Telegram ID

The row of โ€˜expression trueโ€™ blocks (starting from #76) are where you decide what the bot does, when a user sends a specific message, e.g. "hi", "random" or a sticker or photo. Try sending these things and see what happens.

Send /help or /explain to get a more detailed explanation of all the blocks and how to edit them according to your needs. Add your own blocks after #291 (label "/command"); right know that command doesn't do anything.

A bot programmed in Automate might not pick up all your messages because of the flows structure. With good WiFi speed, I find it picks up about 90%.

๐—ข๐˜๐—ต๐—ฒ๐—ฟ ๐—ง๐—ฒ๐—น๐—ฒ๐—ด๐—ฟ๐—ฎ๐—บ ๐—ฏ๐—ผ๐˜ ๐—ณ๐—น๐—ผ๐˜„๐˜€
There are other ways to control your device from Telegram. Another flow of mine uses a dedicated bot that sends Google cloud messages to your device, which you can process in Automate: https://llamalab.com/automate/community/flows/41311.

โ€ข v1.0 (22 april 2020): release
โ€ข v1.1: improved set-up
โ€ข v1.2: added /explain command
โ€ข v1.3: fixed flow stopping when sending "/command"
โ€ข v1.4: added reply to a photo, other textual improvements

4.2 average rating from 5 reviews

5 stars
4 stars
3 stars
2 stars
1 star

Rate and review within the app in the Community section.