mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-01-25 00:34:19 +03:00
Fix custom.Button._is_inline failing for MessageButton
This commit is contained in:
parent
3612652f39
commit
16f7626ceb
|
@ -1,4 +1,5 @@
|
|||
from .. import types
|
||||
from .messagebutton import MessageButton
|
||||
|
||||
|
||||
class Button:
|
||||
|
@ -41,12 +42,14 @@ class Button:
|
|||
"""
|
||||
if isinstance(button, cls):
|
||||
return button.is_inline
|
||||
else:
|
||||
return isinstance(button, (
|
||||
types.KeyboardButtonCallback,
|
||||
types.KeyboardButtonSwitchInline,
|
||||
types.KeyboardButtonUrl
|
||||
))
|
||||
elif isinstance(button, MessageButton):
|
||||
button = button.button
|
||||
|
||||
return isinstance(button, (
|
||||
types.KeyboardButtonCallback,
|
||||
types.KeyboardButtonSwitchInline,
|
||||
types.KeyboardButtonUrl
|
||||
))
|
||||
|
||||
@classmethod
|
||||
def inline(cls, text, callback=None, data=None):
|
||||
|
|
Loading…
Reference in New Issue
Block a user