skip to Main Content

I use this format to send text messages to a special group via my Bot in Telegram , but I don’t know how to send hashtag character in my text ?

https://api.telegram.org/bot/sendMessage?chat_id

3

Answers


  1. Use percent encoding.

    For example: https://api.telegram.org/bot<token>/sendMessage?chat_id=12345678&text=This%20is%20an%20%23hashtag

    Login or Signup to reply.
  2. If you are using php for your bot, you can use this in your script

     "https://api.telegram.org/bot/sendMessage?chat_id=xxxxxxxx&text=".urlencode($text)
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search