mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Fix incorrect type checking in KeyboardBuilder (#674)
* Fix incorrect type checking in KeyboardBuilder * Add a patch note * Update CHANGES/674.bugfix Co-authored-by: Alex Root Junior <jroot.junior@gmail.com> Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
This commit is contained in:
parent
18a93aab60
commit
7c0e229301
2 changed files with 2 additions and 1 deletions
1
CHANGES/674.bugfix
Normal file
1
CHANGES/674.bugfix
Normal file
|
|
@ -0,0 +1 @@
|
|||
Fixed incorrect type checking in the :class:`aiogram.utils.keyboard.KeyboardBuilder`
|
||||
|
|
@ -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())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue