mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Merge 447942989a into 583f00ce31
This commit is contained in:
commit
c663c1f405
2 changed files with 22 additions and 0 deletions
|
|
@ -23,6 +23,7 @@ class InlineKeyboardMarkup(base.TelegramObject):
|
|||
|
||||
conf = kwargs.pop('conf', {}) or {}
|
||||
conf['row_width'] = row_width
|
||||
self.other_kwargs = kwargs
|
||||
|
||||
super(InlineKeyboardMarkup, self).__init__(**kwargs,
|
||||
conf=conf,
|
||||
|
|
@ -80,6 +81,17 @@ class InlineKeyboardMarkup(base.TelegramObject):
|
|||
self.add(button)
|
||||
return self
|
||||
|
||||
def __iadd__(self, other):
|
||||
return self.add(other)
|
||||
|
||||
def __add__(self, other: self.__class__):
|
||||
return self.__class__(
|
||||
inline_keyboard=self.inline_keyboard + other.inline_keyboard,
|
||||
row_width=self.row_width,
|
||||
conf=self.conf,
|
||||
**self.other_kwargs
|
||||
)
|
||||
|
||||
|
||||
class InlineKeyboardButton(base.TelegramObject):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -100,6 +100,16 @@ class ReplyKeyboardMarkup(base.TelegramObject):
|
|||
self.add(button)
|
||||
return self
|
||||
|
||||
def __iadd__(self, other):
|
||||
return self.add(other)
|
||||
|
||||
def __add__(self, other):
|
||||
return self.__class__(
|
||||
keyboard=self.keyboard + other.keyboard, resize_keyboard=self.resize_keyboard,
|
||||
one_time_keyboard=self.one_time_keyboard, selective=self.selective,
|
||||
row_width=self.row_width
|
||||
)
|
||||
|
||||
|
||||
class KeyboardButton(base.TelegramObject):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue