5

I'm writing a telegram bot that will communicate with user and send him url as a result. I want to implement inline button which will do copy to clipboard function for user. I want it because copying text by context menu is a bit longer and not that intuitive.

As I understand I can't do this by server-side code (by Python). So I suppose the only solution is to use Telegram functionality (bot's API and Telegram itself). But I can't find any.

I have found only this answer on stackoverflow. It describes that long press on Mono font does copy text. And it does:

But It seems to me that there's no way to make a link copyable - it always turns to a link.

Can anyone suggest something helpful?

egvo
  • 1,493
  • 18
  • 26
  • 1
    I guess this is only possible if you send the text as plain text (not as a hyperlink), wrapped in the *'inline fixed-width code'* block, as subscribed in the linked post. – 0stone0 Jul 01 '20 at 14:03

1 Answers1

3

Unfortunately you can't do this because you don't have any access to user's clipboard maybe because of security reasons. You can see how are bots different from humans:

So the only possible trick is send as code as @egvo said in the comment.

GameO7er
  • 2,028
  • 1
  • 18
  • 33