Fix custom.Button._is_inline failing for MessageButton

This commit is contained in:
Lonami Exo 2018-08-02 14:53:26 +02:00
parent 3612652f39
commit 16f7626ceb

View File

@ -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):