This topic was automatically generated from Slack. You can find the original thread here.
Sarath Kallakuri : Is it possible to an trigger an event based on the message content sent to Telegram bot? Right now the only option is for any message sent. I am setting up smart home controls, I want to setup something like #lightson#lightsoff as a trigger message.
Thanks
Dylan Sather (Pipedream) : the easiest option is to match on the incoming text and end the workflow early if the message doesn’t contain the text you want. Take a look at this workflow, as an example: Match an incoming Telegram bot pattern, else exit - Pipedream
Dylan Sather (Pipedream) : I confirmed that there’s not, see the Telegram docs here.
The other option: you can modify the trigger code itself. When you create a Telegram trigger, Pipedream creates what we call an event source. If you visit Sources - Pipedream, you’ll see the Telegram source there. Click on that, and visit the Configuration tab, where you’ll see the source’s code. The run method of that code handles the incoming webhooks from Telegram, and calls this.$emit() on every message, which sends the message to the workflow. You can modify the code within the run method to exit early if the message doesn’t match:
Sarath Kallakuri : Thanks for the response. I was considering Pipedream over IFTTT but it seems a little complicated for me. It would be great to have snippets for users like me who are not much into programming. I see that there’s an option to send emails to trigger a webhook. I could use a separate email ID for lights on and lights off or something like that.
I was using Webhook to Alexa Virtual Buttons trigger URL with a Telegram message in IFTTT. https://www.virtualsmarthome.xyz/virtual_routine_trigger/
Dylan Sather (Pipedream) : Just to confirm, did you happen to see that first workflow I shared? You can copy that directly into your account, link your Telegram bot, and you should be up and running.
Dylan Sather (Pipedream) : I think once you get to learn the basics of Pipedream, you’ll find it pretty powerful! A lot of people in our community aren’t coders but are incredibly productive with Pipedream. I’m more than happy to answer any other questions for you.