Can we send command to server from telegram and get an output directly when we send the command.for Example in monitoring Temperature via Telegram,by sending a command to bot and recieve the temperature values from the device…Is it possible.Any help is appreciable…
I think it’s possible. To do so we need to create a command in the telegram bot created (like /send_temp or so- this can be done using /setcommands inbuilt command provided by the botfather while creating a new telegram bot). So, whenever we click this, it sends a request to the server (in which the monitoring temperature code is running continuously).
Also, alterations in the code need to be made as follows:
We need to create a response of the type ‘GET’ so that whenever the server receives this kind of response, we need to send the temperature to the bot by invoking the function which is responsible for the same.
This approach works as per your ideology.
I hope it’s helpful to you.
@dasariaravindh21 I think @pavan24sai has explained everything perfectly. You will need to set up your bot so that it can respond to user input.
Once it gets the correct input, you can make an API call to the Bolt Cloud to get the latest sensor value from the device.