skip to Main Content

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

2

Answers


  1. 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

    Login or Signup to reply.
  2. 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 same chat_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):

    /^(?:http(s)?://)?[w.-]+(?:.[w.-]+)+[w-._~:/?#[]@!$&'()*+,;=.]+$/gm
    

    The bot must be admin on your channel.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search