by Arena Closer
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 flow and send the outcome back to you, like this ready-to-use version with working commands: https://llamalab.com/automate/community/flows/34706.
1. Create a bot in t.me/BotFather
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. This flow uses a dedicated bot that sends Google cloud messages to your device, after which you can process them 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
Rate and review within the app in the Community section.