I am writing a telegram to the bot. I ran into such a problem. I need the bot to send a message (text) when clicked on which it was copied (as a token from @BotFather)
Question posted in Telegram API
A comprehensive official documentation can be found here.
A comprehensive official documentation can be found here.
3
Answers
If I understand you correctly, you wish to send a message, that when the user presses it, the text is automatically copied to the user’s clipboard, just like the BotFather sends the API token?
This is done by the MarkDown
parse_mode
;Send a message with
&parse_mode=MarkDown
and wrap the ‘pressable’ text in back-ticks (`
):EDIT:
Bases on OP’s comment you’re looking for a python-telegram-bot solution.
From there documentation;
You can simply by editing the text in following manner
Write “` then write your text then again write that 3 character .
Bingo!!!
This solution worked for me for the Telegram Android Client as well as the Telegram Desktop client for windows.
And then be sure to set the parse mode to markdown (I’m using V2)
I sent a message to myself to demonstrate:
and with a single click on the message, it gets copied to clipboard!