Skip to content

Commit 4dee785

Browse files
committed
Last of the classes I think
1 parent 38f2064 commit 4dee785

6 files changed

Lines changed: 16 additions & 15 deletions

File tree

telegram/audio.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ def __init__(self,
5757
# Optionals
5858
self.performer = performer
5959
self.title = title
60-
if mime_type:
61-
self.mime_type = str(mime_type)
60+
self.mime_type = mime_type
6261
self.file_size = int(file_size)
6362

6463
@staticmethod

telegram/document.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ def __init__(self, file_id, thumb=None, file_name=None, mime_type=None, file_siz
4747
# Optionals
4848
self.thumb = thumb
4949
self.file_name = file_name
50-
if mime_type:
51-
self.mime_type = str(mime_type)
50+
self.mime_type = mime_type
5251
self.file_size = int(file_size)
5352

5453
@staticmethod

telegram/inlinekeyboardbutton.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,23 @@ class InlineKeyboardButton(TelegramObject):
5151
5252
"""
5353

54-
def __init__(self, text, url=None, callback_data=None, switch_inline_query=None, **kwargs):
54+
def __init__(self,
55+
text,
56+
url=None,
57+
callback_data=None,
58+
switch_inline_query=None,
59+
switch_inline_query_current_chat=None,
60+
callback_game=None,
61+
**kwargs):
5562
# Required
5663
self.text = text
5764

5865
# Optionals
5966
self.url = url
6067
self.callback_data = callback_data
6168
self.switch_inline_query = switch_inline_query
62-
self.switch_inline_query_current_chat = kwargs.get('switch_inline_query_current_chat')
63-
self.callback_game = kwargs.get('callback_game')
69+
self.switch_inline_query_current_chat = switch_inline_query_current_chat
70+
self.callback_game = callback_game
6471

6572
@staticmethod
6673
def de_json(data, bot):

telegram/keyboardbutton.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@ def __init__(self, text, request_contact=None, request_location=None, **kwargs):
3737
# Required
3838
self.text = text
3939
# Optionals
40-
if request_contact:
41-
self.request_contact = request_contact
42-
if request_location:
43-
self.request_location = request_location
40+
self.request_contact = request_contact
41+
self.request_location = request_location
4442

4543
@staticmethod
4644
def de_json(data, bot):

telegram/video.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ def __init__(self,
6262
self.duration = int(duration)
6363
# Optionals
6464
self.thumb = thumb
65-
if mime_type:
66-
self.mime_type = str(mime_type)
65+
self.mime_type = mime_type
6766
self.file_size = int(file_size)
6867

6968
@staticmethod

telegram/voice.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ def __init__(self, file_id, duration, mime_type=None, file_size=0, **kwargs):
4545
self.file_id = str(file_id)
4646
self.duration = int(duration)
4747
# Optionals
48-
if mime_type:
49-
self.mime_type = str(mime_type)
48+
self.mime_type = mime_type
5049
self.file_size = int(file_size)
5150

5251
@staticmethod

0 commit comments

Comments
 (0)