Fix incorrect type checking in KeyboardBuilder

This commit is contained in:
Daniil Kovalenko 2021-08-27 18:03:49 +07:00 committed by GitHub
parent 18a93aab60
commit 485b9836d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -232,7 +232,7 @@ class KeyboardBuilder(Generic[ButtonType]):
return self.add(button)
def as_markup(self, **kwargs: Any) -> Union[InlineKeyboardMarkup, ReplyKeyboardMarkup]:
if self._button_type is ReplyKeyboardMarkup:
if self._button_type is KeyboardButton:
return ReplyKeyboardMarkup(keyboard=self.export(), **kwargs)
return InlineKeyboardMarkup(inline_keyboard=self.export())