mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-01-10 20:12:52 +01:00
Revert switch_inline_query #232
This commit is contained in:
parent
e56c6dfab6
commit
a8255e4f51
3 changed files with 6 additions and 2 deletions
|
@ -52,10 +52,12 @@ class InlineKeyboardButton(TelegramObject):
|
||||||
# Optionals
|
# Optionals
|
||||||
self.url = kwargs.get('url')
|
self.url = kwargs.get('url')
|
||||||
self.callback_data = kwargs.get('callback_data')
|
self.callback_data = kwargs.get('callback_data')
|
||||||
self.switch_inline_query = kwargs.get('switch_inline_query', '')
|
self.switch_inline_query = kwargs.get('switch_inline_query')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def de_json(data):
|
def de_json(data):
|
||||||
|
data = super(InlineKeyboardButton, InlineKeyboardButton).de_json(data)
|
||||||
|
|
||||||
if not data:
|
if not data:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,8 @@ class InlineQuery(TelegramObject):
|
||||||
Returns:
|
Returns:
|
||||||
telegram.InlineQuery:
|
telegram.InlineQuery:
|
||||||
"""
|
"""
|
||||||
|
data = super(InlineQuery, InlineQuery).de_json(data)
|
||||||
|
|
||||||
if not data:
|
if not data:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ class InlineQueryTest(BaseTest, unittest.TestCase):
|
||||||
inlinequery = telegram.InlineQuery.de_json(self.json_dict).to_dict()
|
inlinequery = telegram.InlineQuery.de_json(self.json_dict).to_dict()
|
||||||
|
|
||||||
self.assertTrue(self.is_dict(inlinequery))
|
self.assertTrue(self.is_dict(inlinequery))
|
||||||
# self.assertDictEqual(inlinequery, self.json_dict)
|
self.assertDictEqual(inlinequery, self.json_dict)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in a new issue