mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 20:59:29 +00:00
Fix Inline buttons parsing
This commit is contained in:
parent
921800f902
commit
f0138ce555
@ -110,21 +110,21 @@ class InlineKeyboardButton(PyrogramType):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def write(self):
|
def write(self):
|
||||||
if self.callback_data:
|
if self.callback_data is not None:
|
||||||
return KeyboardButtonCallback(text=self.text, data=self.callback_data)
|
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)
|
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)
|
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(
|
return KeyboardButtonSwitchInline(
|
||||||
text=self.text,
|
text=self.text,
|
||||||
query=self.switch_inline_query_current_chat,
|
query=self.switch_inline_query_current_chat,
|
||||||
same_peer=True
|
same_peer=True
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.callback_game:
|
if self.callback_game is not None:
|
||||||
return KeyboardButtonGame(text=self.text)
|
return KeyboardButtonGame(text=self.text)
|
||||||
|
Loading…
Reference in New Issue
Block a user