From f0138ce555f87ea3d8a1950d4de050a2016111f5 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Fri, 22 Mar 2019 11:58:49 +0100 Subject: [PATCH] Fix Inline buttons parsing --- pyrogram/client/types/bots/inline_keyboard_button.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyrogram/client/types/bots/inline_keyboard_button.py b/pyrogram/client/types/bots/inline_keyboard_button.py index ff6f3cdb..c0c3eb8c 100644 --- a/pyrogram/client/types/bots/inline_keyboard_button.py +++ b/pyrogram/client/types/bots/inline_keyboard_button.py @@ -110,21 +110,21 @@ class InlineKeyboardButton(PyrogramType): ) def write(self): - if self.callback_data: + if self.callback_data is not None: return KeyboardButtonCallback(text=self.text, data=self.callback_data) - if self.url: + if self.url is not None: return KeyboardButtonUrl(text=self.text, url=self.url) - if self.switch_inline_query: + if self.switch_inline_query is not None: return KeyboardButtonSwitchInline(text=self.text, query=self.switch_inline_query) - if self.switch_inline_query_current_chat: + if self.switch_inline_query_current_chat is not None: return KeyboardButtonSwitchInline( text=self.text, query=self.switch_inline_query_current_chat, same_peer=True ) - if self.callback_game: + if self.callback_game is not None: return KeyboardButtonGame(text=self.text)