def markup(): markup = InlineKeyboardMarkup() markup.row_width = 2 markup.add( InlineKeyboardButton("Help", callback_data="help"), InlineKeyboardButton("Add me to group", url="t.me/{}?startgroup=new".format(botname))) return markup
def build_keyboard(buttons): keyb = [] for btn in buttons: if btn.same_line and keyb: keyb[-1].add(InlineKeyboardButton(btn.name, url=btn.url)) else: keyb.append(InlineKeyboardButton(btn.name, url=btn.url)) return keyb
def help_markup(): help_markup = InlineKeyboardMarkup() help_markup.row_width = 2 help_markup.add(InlineKeyboardButton("Admin", callback_data="admin"), InlineKeyboardButton("Greetings", callback_data="welcome")) help_markup.add( InlineKeyboardButton("Google Translate", callback_data="translate"), InlineKeyboardButton("Misc", callback_data="misc")) return help_markup
def help_back(): help_back = InlineKeyboardMarkup() help_back.row_width = 1 help_back.add(InlineKeyboardButton("🔙 Back", callback_data="help_back")) return help_back