I have a simple bot telegram, I want to send hashtags to a telegram like "# myheshtag", but when the line starts with #, the message is not sent.

import requests import misc token = misc.token URL = 'https://api.telegram.org/bot' + token + '/' def send_message(chat_id, text): url = URL + 'sendmessage?chat_id={}&text={}'.format(chat_id, text) requests.get(url) def main(): send_message('-1001351502373', '#MyTeg') if __name__ == '__main__': main() 

Tell me how to solve the problem? Thank!

  • 2
    It's not a bot, but that you use a key symbol. Encode a string according to all URL rules and only then send a request - Kir_Antipov 5:28 pm
  • In addition to the prev. commentator stackoverflow.com/questions/1695183/… - XxX

0