Created
May 15, 2020 10:37
-
-
Save RustemB/3121e353863ac966e4922428660fa157 to your computer and use it in GitHub Desktop.
tgme
This file contains 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
#!/usr/bin/env python3 | |
import urllib.request as ur | |
import urllib.parse as up | |
from sys import argv | |
WEBHOOK_URL = "https://api.telegram.org" | |
BOT_API = "HERE_YORS_BOT_TOKEN_FROM_BOTFATHER" | |
DATA = up.urlencode({ | |
'text': argv[1], | |
'chat_id': YOUR_ID, | |
}) | |
with ur.urlopen("{}/bot{}/sendMessage?{}".format(WEBHOOK_URL, BOT_API, DATA)) as _: pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment