Search code examples
telegramtelegram-bot

How to restrict people forwarding or saving content received from a Telegram bot?


I recently communicated with a bot that had this feature - I could not save photos nor videos that he sent me.

But when I create my own bot, I struggle to find such a setting.

Please advise...


Solution

  • You are looking for the protect_content option of sendMessage (or sendPhoto/sendVideo etc.). For example, this should send you a text message that cannot be forwarded: https://api.telegram.org/bot[token]/sendMessage?chat_id=[id]&text=Not%20forwardable&protect_content=true

    (Remember to replace [token] with your bot token as well as [id] with your chat ID)