예제 #1
0
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
예제 #2
0
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
예제 #3
0
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
예제 #4
0
def help_back():
    help_back = InlineKeyboardMarkup()
    help_back.row_width = 1
    help_back.add(InlineKeyboardButton("🔙 Back", callback_data="help_back"))
    return help_back