mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-13 11:18:20 +01:00
Add kwargs to API calls #302
This commit is contained in:
parent
108e4264fc
commit
ab2f6e13c9
11 changed files with 18 additions and 12 deletions
|
@ -142,7 +142,7 @@ class Bot(TelegramObject):
|
|||
return decorator
|
||||
|
||||
@log
|
||||
def getMe(self):
|
||||
def getMe(self, **kwargs):
|
||||
"""A simple method for testing your bot's auth token.
|
||||
|
||||
Returns:
|
||||
|
@ -1170,7 +1170,7 @@ class Bot(TelegramObject):
|
|||
return url, data
|
||||
|
||||
@log
|
||||
def getUpdates(self, offset=None, limit=100, timeout=0, network_delay=.2):
|
||||
def getUpdates(self, offset=None, limit=100, timeout=0, network_delay=.2, **kwargs):
|
||||
"""Use this method to receive incoming updates using long polling.
|
||||
|
||||
Args:
|
||||
|
|
|
@ -41,7 +41,13 @@ class ChosenInlineResult(TelegramObject):
|
|||
|
||||
"""
|
||||
|
||||
def __init__(self, result_id, from_user, query, location=None, inline_message_id=None):
|
||||
def __init__(self,
|
||||
result_id,
|
||||
from_user,
|
||||
query,
|
||||
location=None,
|
||||
inline_message_id=None,
|
||||
**kwargs):
|
||||
# Required
|
||||
self.result_id = result_id
|
||||
self.from_user = from_user
|
||||
|
|
|
@ -33,7 +33,7 @@ class InlineKeyboardMarkup(ReplyMarkup):
|
|||
|
||||
"""
|
||||
|
||||
def __init__(self, inline_keyboard):
|
||||
def __init__(self, inline_keyboard, **kwargs):
|
||||
# Required
|
||||
self.inline_keyboard = inline_keyboard
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ from telegram import InputMessageContent
|
|||
class InputContactMessageContent(InputMessageContent):
|
||||
"""Base class for Telegram InputContactMessageContent Objects"""
|
||||
|
||||
def __init__(self, phone_number, first_name, last_name=None):
|
||||
def __init__(self, phone_number, first_name, last_name=None, **kwargs):
|
||||
# Required
|
||||
self.phone_number = phone_number
|
||||
self.first_name = first_name
|
||||
|
|
|
@ -25,7 +25,7 @@ from telegram import InputMessageContent
|
|||
class InputLocationMessageContent(InputMessageContent):
|
||||
"""Base class for Telegram InputLocationMessageContent Objects"""
|
||||
|
||||
def __init__(self, latitude, longitude):
|
||||
def __init__(self, latitude, longitude, **kwargs):
|
||||
# Required
|
||||
self.latitude = latitude
|
||||
self.longitude = longitude
|
||||
|
|
|
@ -25,7 +25,7 @@ from telegram import InputMessageContent
|
|||
class InputTextMessageContent(InputMessageContent):
|
||||
"""Base class for Telegram InputTextMessageContent Objects"""
|
||||
|
||||
def __init__(self, message_text, parse_mode=None, disable_web_page_preview=None):
|
||||
def __init__(self, message_text, parse_mode=None, disable_web_page_preview=None, **kwargs):
|
||||
# Required
|
||||
self.message_text = message_text
|
||||
# Optionals
|
||||
|
|
|
@ -25,7 +25,7 @@ from telegram import InputMessageContent
|
|||
class InputVenueMessageContent(InputMessageContent):
|
||||
"""Base class for Telegram InputVenueMessageContent Objects"""
|
||||
|
||||
def __init__(self, latitude, longitude, title, address, foursquare_id=None):
|
||||
def __init__(self, latitude, longitude, title, address, foursquare_id=None, **kwargs):
|
||||
# Required
|
||||
self.latitude = latitude
|
||||
self.longitude = longitude
|
||||
|
|
|
@ -33,7 +33,7 @@ class KeyboardButton(TelegramObject):
|
|||
request_contact (Optional[bool]):
|
||||
"""
|
||||
|
||||
def __init__(self, text, request_contact=None, request_location=None):
|
||||
def __init__(self, text, request_contact=None, request_location=None, **kwargs):
|
||||
# Required
|
||||
self.text = text
|
||||
# Optionals
|
||||
|
|
|
@ -33,7 +33,7 @@ class Location(TelegramObject):
|
|||
latitude (float):
|
||||
"""
|
||||
|
||||
def __init__(self, longitude, latitude):
|
||||
def __init__(self, longitude, latitude, **kwargs):
|
||||
# Required
|
||||
self.longitude = float(longitude)
|
||||
self.latitude = float(latitude)
|
||||
|
|
|
@ -34,7 +34,7 @@ class UserProfilePhotos(TelegramObject):
|
|||
photos (List[List[:class:`telegram.PhotoSize`]]):
|
||||
"""
|
||||
|
||||
def __init__(self, total_count, photos):
|
||||
def __init__(self, total_count, photos, **kwargs):
|
||||
# Required
|
||||
self.total_count = int(total_count)
|
||||
self.photos = photos
|
||||
|
|
|
@ -32,7 +32,7 @@ class Venue(TelegramObject):
|
|||
foursquare_id (Optional[str]):
|
||||
"""
|
||||
|
||||
def __init__(self, location, title, address, foursquare_id=None):
|
||||
def __init__(self, location, title, address, foursquare_id=None, **kwargs):
|
||||
# Required
|
||||
self.location = location
|
||||
self.title = title
|
||||
|
|
Loading…
Add table
Reference in a new issue