1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Add delete webhook.

This commit is contained in:
eternnoir 2016-12-06 11:52:16 +08:00
parent eadff07f79
commit a06551daaf
2 changed files with 12 additions and 0 deletions

View File

@ -80,6 +80,13 @@ class TeleBot:
def set_webhook(self, url=None, certificate=None, max_connections=None, allowed_updates=None):
return apihelper.set_webhook(self.token, url, certificate, max_connections, allowed_updates)
def delete_webhook(self):
"""
Use this method to remove webhook integration if you decide to switch back to getUpdates.
:return: bool
"""
return apihelper.delete_webhook(self.token)
def get_webhook_info(self):
result = apihelper.get_webhook_info(self.token)
return types.WebhookInfo.de_json(result)

View File

@ -130,6 +130,11 @@ def set_webhook(token, url=None, certificate=None, max_connections=None, allowed
return _make_request(token, method_url, params=payload, files=files)
def delete_webhook(token):
method_url = r'deleteWebhook'
return _make_request(token, method_url)
def get_webhook_info(token):
method_url = r'getWebhookInfo'
payload = {}