Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save softdream1981/e9d8ec4fea42300f8a153847a0ba0d74 to your computer and use it in GitHub Desktop.

Select an option

Save softdream1981/e9d8ec4fea42300f8a153847a0ba0d74 to your computer and use it in GitHub Desktop.

Revisions

  1. @manhay212 manhay212 revised this gist Aug 25, 2018. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions telegram_bot_sendtext.py
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    import requests

    def telegram_bot_sendtext(bot_message):

    bot_token = ''
  2. @manhay212 manhay212 created this gist Aug 25, 2018.
    13 changes: 13 additions & 0 deletions telegram_bot_sendtext.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    def telegram_bot_sendtext(bot_message):

    bot_token = ''
    bot_chatID = ''
    send_text = 'https://api.telegram.org/bot' + bot_token + '/sendMessage?chat_id=' + bot_chatID + '&parse_mode=Markdown&text=' + bot_message

    response = requests.get(send_text)

    return response.json()


    test = telegram_bot_sendtext("Testing Telegram bot")
    print(test)