Merge remote-tracking branch 'origin/october3' into october3

This commit is contained in:
Jacob Bom 2016-10-03 20:10:14 +02:00
commit f3b8a3a5e9
2 changed files with 14 additions and 6 deletions

View file

@ -1432,14 +1432,12 @@ class Bot(TelegramObject):
the definitive timeout (in seconds) for urlopen() operations.
Returns:
:class:`telegram.ChatMember`: On success,
:class:`telegram.ChatMember` is returned.
:class:`telegram.ChatMember`
Raises:
:class:`telegram.TelegramError`
"""
url = '{0}/getChatMember'.format(self.base_url)
data = {'chat_id': chat_id, 'user_id': user_id}
@ -1449,6 +1447,14 @@ class Bot(TelegramObject):
return ChatMember.de_json(result, self)
def getWebhookInfo(self, **kwargs):
"""Use this method to get current webhook status.
If the bot is using getUpdates, will return an object with the url field empty.
Returns:
:class: `telegram.WebhookInfo`
"""
url = '{0}/getWebhookInfo'.format(self.base_url)
data = {}
@ -1475,7 +1481,7 @@ class Bot(TelegramObject):
return (self.__class__, (self.token, self.base_url.replace(self.token, ''),
self.base_file_url.replace(self.token, '')))
# snake_case (PEP8) aliases
# snake_case (PEP8) aliases
get_me = getMe
send_message = sendMessage

View file

@ -25,18 +25,19 @@ class WebhookInfo(TelegramObject):
"""This object represents a Telegram WebhookInfo.
Attributes:
url (str): Webhook URL, may be empty if webhook is not set up
url (str): Webhook URL, may be empty if webhook is not set up.
has_custom_certificate (bool):
pending_update_count (int):
last_error_date (Optional[int]):
last_error_message (Optional[str]):
Args:
url (str): Webhook URL, may be empty if webhook is not set up
url (str): Webhook URL, may be empty if webhook is not set up.
has_custom_certificate (bool):
pending_update_count (int):
last_error_date (Optional[int]):
last_error_message (Optional[str]):
"""
def __init__(self, url, has_custom_certificate, pending_update_count, **kwargs):
@ -56,6 +57,7 @@ class WebhookInfo(TelegramObject):
Returns:
telegram.WebhookInfo:
"""
if not data:
return None