skip to Main Content

I try to send a telegram message from python through the api, the message is a preformed text like the following:

message = (f"```test: Hello World n"
           f"time : {datetime.datetime.now()}```")

but I only receive the following in the telegram bot:

enter image description here

As you can see in the image, the word test: is missing

From now, thank you for you help guys!

2

Answers


  1. Chosen as BEST ANSWER

    After some time reading on the internet, I found this other solution:

    message = (f"```pythonn"
               f"test : Hello World n"
               f"time : {datetime.datetime.now()}"
               f"```")
    

  2. Add a newline(n) after the markdown syntax:

    message = (f"```ntest: Hello World n"
               f"time : {datetime.datetime.now()}```")
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search