Is it possible to add a bot in a telegram channel that would open any link as soon as it is put in the channel
Question posted in Telegram API
A comprehensive official documentation can be found here.
A comprehensive official documentation can be found here.
2
Answers
Yes it is possible but the bot will need to run all the time in the background, so you need to keep your PC always on or host the bot on the cloud
Yes, it is possible. You can set a webhook for your bot so each time the bot recives an update (i.e. a private message, channel posts, messages from groups…) the bot will run its script. In this script you check wheter the
chat_id
of the message sent to the bot is the samechat_id
of your channel. If so, check if the message contains a link and open it.To search for link in a message you can use Regex with this expression (try here):
The bot must be admin on your channel.