-
-
Save mosessoh/c047821e963562cc5701802ad3b6e147 to your computer and use it in GitHub Desktop.
Set webhook for Telegram API
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
from pprint import pprint | |
import requests | |
bot_token = <your-bot-token> | |
test_url = "<your-https-url>/{}".format(bot_token) | |
def get_url(method): | |
return "https://api.telegram.org/bot{}/{}".format(bot_token,method) | |
r = requests.get(get_url("setWebhook"), data={"url": test_url}) | |
r = requests.get(get_url("getWebhookInfo")) | |
pprint(r.status_code) | |
pprint(r.json()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment