yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.3k stars 1.5k forks source link

[Question] Can't manage to use protect_content on sending messages. #1018

Closed tambu22 closed 1 year ago

tambu22 commented 1 year ago

I'm trying to send messages and protect them from forward and save.

My code: bot.sendMessage(chatId, messageText, { parse_mode: "Markdown", protect_content: true, reply_markup: JSON.stringify({ inline_keyboard: myInlineButtons }), });

Lib version: "node-telegram-bot-api": "^0.56.0",

danielperez9430 commented 1 year ago

Hi @tambu22 The method works like you did, and also the content have this flag (you can see it on reply to the message in your bot. The problem of the "forward" and "save" is more Telegram Clients (how it works). And yes, a protected content is possible to save in your device.

For example in Telegram MacOs when you forward a protected message you have something like this:

image

But if you click on retry the client send the message as copy... So yes, the protected content implementation from Telegram is something weired.