How can we get the message from telegram as input to our program?

Like we have control LED from website by using ON /OFF buttons.
Can we creat the same function for LED by taking massage as input from telegram?
Eg: if I send ON as massage to the telegram bot the LED should be turned ON.
When I sen OFF as message to the telegram bot the LED should be turned OFF.
Is this possible?

Hi @rafeekbcr918 ,
Yes, it should be possible. I will check it and will update you soon.

1 Like

Hi @rafeekbcr918, yes it is possible to do so. One of the methods is through IFTTT
It is a software platform that connects apps, devices and services from different developers in order to trigger one or more automations involving those apps, devices and services.
I’ve used this for my voice controlled robot project using Google Assistance. They provide number of services and one of them is Telegram too.
I’ve attached the screenshots with steps for your understanding.

Step 1: Visit the IFTTT website and log in using google account.

Step 2: Tap on “create” and then “Add”


Step 3: Search “Telegram” in the search bar.

Step 4: Choose any trigger you want according to your need, I guess the 1 I selected will work for you.

Step 5: Connect with your Telegram account and follow the instructions given by bot in telegram.


Step 6: After that you can see your account in the trigger fields.

Step 7: Tap on “connect new groups” and connect with your group(its ok to have only you in the group)
image

Step 8: Add the key phrase and the reply you want, then press “Create trigger”.

Step 9: Tap the “Add” button and search for “Webhooks” in the search bar.


Step 10: Now choose “Make a web request” option.

Step 11: Add your desired web request URL and fill other fields as mentioned below and press “Create action”

Step 12: Follow the below instructions:


If everything went well you should be able to see the following window:

Now to make request in the telegram type the Phrase word with “/ifttt”:

You should get the response like that:
image

THAT’s IT!!
I hope your LED is ON now.

2 Likes

@rafeekbcr918 Please try the steps provided by @mr.sushen , it will surely work.
@mr.sushen Thank you for giving such a detailed example.

I will try . Thank you brothers. @raghav.srivastava @mr.sushen

1 Like