mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-04 05:34:41 +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 .. import types
|
||||||
|
from .messagebutton import MessageButton
|
||||||
|
|
||||||
|
|
||||||
class Button:
|
class Button:
|
||||||
|
@ -41,12 +42,14 @@ class Button:
|
||||||
"""
|
"""
|
||||||
if isinstance(button, cls):
|
if isinstance(button, cls):
|
||||||
return button.is_inline
|
return button.is_inline
|
||||||
else:
|
elif isinstance(button, MessageButton):
|
||||||
return isinstance(button, (
|
button = button.button
|
||||||
types.KeyboardButtonCallback,
|
|
||||||
types.KeyboardButtonSwitchInline,
|
return isinstance(button, (
|
||||||
types.KeyboardButtonUrl
|
types.KeyboardButtonCallback,
|
||||||
))
|
types.KeyboardButtonSwitchInline,
|
||||||
|
types.KeyboardButtonUrl
|
||||||
|
))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def inline(cls, text, callback=None, data=None):
|
def inline(cls, text, callback=None, data=None):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user