-
-
Save Umbrien/2d063351f04d3a6295a68d60af7867b1 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': ' '.join(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