def get_button_rows(self): buttons = [ dict(text=(emoji.OK, 'Да') if self.with_icons else 'Да', callback_data='%s yes' % base_utils.join(*self.args)), dict(text=(emoji.CANCEL, 'Нет') if self.with_icons else 'Нет', callback_data='%s no' % base_utils.join(*self.args)), ] return [buttons]
def __init__(self, tguser, items: list, *args, in_line: int = 5, show_item=False, item_str_func='__str__'): super().__init__(tguser, *args) self.items = items self.in_line = in_line self.show_item = show_item self.item_str_func = item_str_func args = list(self.args) if '%s' not in args: args.append('%s') self.command = base_utils.join(*args)
def get_self_button(self) -> dict: return self.get_button(callback_data=base_utils.join(*self.args))