Should fix empty string but set args #232

This commit is contained in:
Leandro Toledo 2016-04-21 09:56:57 -03:00
parent bb36c725af
commit 3be8b9ecb9
2 changed files with 4 additions and 4 deletions

View file

@ -65,7 +65,7 @@ class TelegramObject(object):
data = dict()
for key, value in self.__dict__.items():
if value:
if value or value == '':
if hasattr(value, 'to_dict'):
data[key] = value.to_dict()
else:

View file

@ -50,9 +50,9 @@ class InlineKeyboardButton(TelegramObject):
self.text = text
# Optionals
self.url = kwargs.get('url', '')
self.callback_data = kwargs.get('callback_data', '')
self.switch_inline_query = kwargs.get('switch_inline_query', '')
self.url = kwargs.get('url')
self.callback_data = kwargs.get('callback_data')
self.switch_inline_query = kwargs.get('switch_inline_query')
@staticmethod
def de_json(data):