skip to Main Content

I use a Telegram-bot for sending updates from my Home Automation. I like to do some text styling for easier reading and a quick notice of special messages. Mostly I use bold, italic or underlined text, but I discovered the pre-tag for a code block. I like to use this tag for error-messages for example.

But when I tested it I used a short text, that looked fine! Now I received a longer message and a copy-button appeared…
Below an example of a short (without button) and a longer message (with button).

enter image description here

I don’t like that button! I don’t want that button!

I used the same <pre> and </pre> tags for both blocks. So it appears only based on length I think…?

Does someone know a way to make it disapear or disable it?

2

Answers


  1. It is not possible to remove this button at this time. But there is an alternative solution: use a pre-tag on each line. What I mean:

    message:

    <pre>pre block</pre>
    <pre>pre block</pre>
    <pre>pre block</pre>
    
    --------------------
    
    <pre>pre block</pre>
    
    <pre>pre block</pre>
    
    <pre>pre block</pre>
    

    result:
    enter image description here

    By the way, even if the string takes two/three lines, it will still work without the button.

    Login or Signup to reply.
  2. As a workaround (I used), you can use <code>your preformatted multi-lines paragraph here</code>, it will not show [Copy] button in Telegram Desktop (Windows) and Telegram Mobile (Android).

    I don’t have clients on other platforms to test.

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