BOT to answer only if the command is written in a group

Telegram BOT. It gets triggered by a command “/ask” and replies into the group.
However the command is sent as private message, it still replies into the group but group users cannot see who wrote the command.
How can I add a condition to let him reply privately something else if it receives the command privately?

thanks in advance

Hi @sprachencafewien,

To have the bot response privately, you’ll need to change you ChatID of the private channel

I believe the internet has tutorial on how to get the ChatID of the private channel. You can try to search for it.

what about the “IF” condition? to change the behaviour of the BOT? How to set it?

Hi @sprachencafewien

You’ll need to use code to conditionally send HTTP requests, like responding differently based on a condition. You can see an example here: