Example #1
0
def menu():
    btn1 = methods.button("Dialogs", "menu_dialogs")
    btn2 = methods.button("Triggers", "menu_triggers")
    btn3 = methods.button("Sections", "menu_sections")
    btn4 = methods.button("Options", "menu_options")
    close = methods.button("Close", "menu_close")
    return methods.inline_keyboard([[btn1, btn2, btn3], [btn4], [close]])
Example #2
0
def delete_bot():
    row1 = [methods.button("Yes", "delete_bot_yes")]
    row2 = [methods.button("No", "delete_bot_no")]
    row3 = [methods.button("No", "delete_bot_no")]
    rows = [row1, row2, row3]
    random.shuffle(rows)
    return methods.inline_keyboard(rows)
Example #3
0
def menu_options(bot):
    symb = "ON" if bot.automs_enabled else "OFF"
    c_symb = bot.custom_command_symb
    btn1 = methods.button(f"Automatic Messages: {symb}", "options_autom")
    btn2 = methods.button(f"Command Symbol: {c_symb}", "options_comm_symbol")
    btn3 = methods.button("Delete bot", "options_delete_bot")
    back = methods.button("Back", "options_back")
    return methods.inline_keyboard([[btn1], [btn2], [btn3], [back]])
Example #4
0
def trigger_type():
    btn1 = methods.button("Interaction", "interaction")
    btn2 = methods.button("Content", "content")
    btn3 = methods.button("Equal", "equal")
    btn4 = methods.button("Eteraction", "eteraction")
    btn5 = methods.button("Command", "command")
    btn_canc = methods.button("Cancel", "cancel")
    return methods.inline_keyboard([[btn1, btn2], [btn3, btn4], [btn5],
                                    [btn_canc]])
def parse_buttons(reply: str) -> [str, Optional[Dict]]:
    btns = []
    for row in re.findall(r"\[(.+?)\]", reply):
        btn_row = []
        for link, text in re.findall(r"<btn:(.+?)\|(.+?)>", row):
            btn_row.append(methods.link_button(text, link))
        if btn_row:
            reply = re.sub(rf"\[({re.escape(row)})\]", "", reply)
            btns.append(btn_row)
    return reply, methods.inline_keyboard(btns) if btns else None
Example #6
0
def cancel():
    btn = methods.button("Cancel", "cancel")
    return methods.inline_keyboard([[btn]])
Example #7
0
def done():
    btn = methods.button("Done", "done")
    return methods.inline_keyboard([[btn]])
Example #8
0
def menu_sections():
    btn1 = methods.button("Del Section", "del_section")
    btn2 = methods.button("List Sections", "list_sections")
    back = methods.button("Back", "menu_back")
    return methods.inline_keyboard([[btn1], [btn2], [back]])
Example #9
0
def menu_triggers():
    btn1 = methods.button("Add Trigger", "add_trigger")
    btn2 = methods.button("Del. Trigger", "del_trigger")
    btn4 = methods.button("List Triggers", "list_triggers")
    back = methods.button("Back", "menu_back")
    return methods.inline_keyboard([[btn1, btn2], [btn4], [back]])
Example #10
0
def menu_dialogs():
    btn1 = methods.button("Add Dialog", "add_dialog")
    btn2 = methods.button("Del. Dialog", "del_dialog")
    btn4 = methods.button("List Dialogs", "list_dialogs")
    back = methods.button("Back", "menu_back")
    return methods.inline_keyboard([[btn1, btn2], [btn4], [back]])