Created
June 21, 2021 12:45
-
-
Save passionsjin/697ea8909ec252096036f1a979f85d49 to your computer and use it in GitHub Desktop.
Telegram Rest API (SendMessage)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def send_msg(msg): | |
req = requests.post(url=f'https://api.telegram.org/bot{token}/sendMessage', | |
json={'chat_id': chat_id, | |
'text': msg}) | |
return req.text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment