X Tutup
Skip to content

Commit a8255e4

Browse files
committed
Revert switch_inline_query python-telegram-bot#232
1 parent e56c6df commit a8255e4

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

telegram/inlinekeyboardbutton.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@ def __init__(self,
5252
# Optionals
5353
self.url = kwargs.get('url')
5454
self.callback_data = kwargs.get('callback_data')
55-
self.switch_inline_query = kwargs.get('switch_inline_query', '')
55+
self.switch_inline_query = kwargs.get('switch_inline_query')
5656

5757
@staticmethod
5858
def de_json(data):
59+
data = super(InlineKeyboardButton, InlineKeyboardButton).de_json(data)
60+
5961
if not data:
6062
return None
6163

telegram/inlinequery.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ def de_json(data):
6262
Returns:
6363
telegram.InlineQuery:
6464
"""
65+
data = super(InlineQuery, InlineQuery).de_json(data)
66+
6567
if not data:
6668
return None
6769

tests/test_inlinequery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_inlinequery_to_dict(self):
7070
inlinequery = telegram.InlineQuery.de_json(self.json_dict).to_dict()
7171

7272
self.assertTrue(self.is_dict(inlinequery))
73-
# self.assertDictEqual(inlinequery, self.json_dict)
73+
self.assertDictEqual(inlinequery, self.json_dict)
7474

7575

7676
if __name__ == '__main__':

0 commit comments

Comments
 (0)
X Tutup