mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-17 04:39:55 +01:00
Last of the classes I think
This commit is contained in:
parent
38f2064639
commit
4dee785fba
6 changed files with 16 additions and 15 deletions
|
@ -57,8 +57,7 @@ class Audio(TelegramObject):
|
|||
# Optionals
|
||||
self.performer = performer
|
||||
self.title = title
|
||||
if mime_type:
|
||||
self.mime_type = str(mime_type)
|
||||
self.mime_type = mime_type
|
||||
self.file_size = int(file_size)
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -47,8 +47,7 @@ class Document(TelegramObject):
|
|||
# Optionals
|
||||
self.thumb = thumb
|
||||
self.file_name = file_name
|
||||
if mime_type:
|
||||
self.mime_type = str(mime_type)
|
||||
self.mime_type = mime_type
|
||||
self.file_size = int(file_size)
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -51,7 +51,14 @@ class InlineKeyboardButton(TelegramObject):
|
|||
|
||||
"""
|
||||
|
||||
def __init__(self, text, url=None, callback_data=None, switch_inline_query=None, **kwargs):
|
||||
def __init__(self,
|
||||
text,
|
||||
url=None,
|
||||
callback_data=None,
|
||||
switch_inline_query=None,
|
||||
switch_inline_query_current_chat=None,
|
||||
callback_game=None,
|
||||
**kwargs):
|
||||
# Required
|
||||
self.text = text
|
||||
|
||||
|
@ -59,8 +66,8 @@ class InlineKeyboardButton(TelegramObject):
|
|||
self.url = url
|
||||
self.callback_data = callback_data
|
||||
self.switch_inline_query = switch_inline_query
|
||||
self.switch_inline_query_current_chat = kwargs.get('switch_inline_query_current_chat')
|
||||
self.callback_game = kwargs.get('callback_game')
|
||||
self.switch_inline_query_current_chat = switch_inline_query_current_chat
|
||||
self.callback_game = callback_game
|
||||
|
||||
@staticmethod
|
||||
def de_json(data, bot):
|
||||
|
|
|
@ -37,10 +37,8 @@ class KeyboardButton(TelegramObject):
|
|||
# Required
|
||||
self.text = text
|
||||
# Optionals
|
||||
if request_contact:
|
||||
self.request_contact = request_contact
|
||||
if request_location:
|
||||
self.request_location = request_location
|
||||
self.request_contact = request_contact
|
||||
self.request_location = request_location
|
||||
|
||||
@staticmethod
|
||||
def de_json(data, bot):
|
||||
|
|
|
@ -62,8 +62,7 @@ class Video(TelegramObject):
|
|||
self.duration = int(duration)
|
||||
# Optionals
|
||||
self.thumb = thumb
|
||||
if mime_type:
|
||||
self.mime_type = str(mime_type)
|
||||
self.mime_type = mime_type
|
||||
self.file_size = int(file_size)
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -45,8 +45,7 @@ class Voice(TelegramObject):
|
|||
self.file_id = str(file_id)
|
||||
self.duration = int(duration)
|
||||
# Optionals
|
||||
if mime_type:
|
||||
self.mime_type = str(mime_type)
|
||||
self.mime_type = mime_type
|
||||
self.file_size = int(file_size)
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Add table
Reference in a new issue