ShopBot/keyboard/default/main_menu.py

44 lines
1.4 KiB
Python
Raw Permalink Normal View History

2022-06-04 22:02:51 +03:00
from aiogram.types.reply_keyboard import ReplyKeyboardMarkup, KeyboardButton
from load import messages
def main_menu(admin=False, operator=False):
markup = ReplyKeyboardMarkup(
[
[
2022-06-05 15:02:41 +03:00
KeyboardButton(messages.catalog), # Go to catalog
KeyboardButton(messages.cart) # Go to cart
2022-06-04 22:02:51 +03:00
]
],
resize_keyboard=True
).add(KeyboardButton(messages.info))
2022-06-05 15:02:41 +03:00
if admin:
2022-06-04 22:02:51 +03:00
markup.add(KeyboardButton(messages.admin_panel))
2022-06-05 15:02:41 +03:00
if operator:
2022-06-04 22:02:51 +03:00
markup.add(KeyboardButton(messages.operator_panel))
return markup
def cart_btn(is_empty=True):
markup = ReplyKeyboardMarkup(resize_keyboard=True)
if not is_empty:
markup.add(KeyboardButton(messages.checkout))
markup.add(KeyboardButton(messages.clean_cart))
markup.add(KeyboardButton(messages.back))
return markup
2022-06-05 15:02:41 +03:00
back_to_main_menu = ReplyKeyboardMarkup(keyboard=[[KeyboardButton(messages.back)]], resize_keyboard=True)
2022-06-04 22:02:51 +03:00
cancel_btn = ReplyKeyboardMarkup([[KeyboardButton(messages.cancel_message)]], resize_keyboard=True)
get_phone_number = ReplyKeyboardMarkup(
keyboard=[
[KeyboardButton(messages.contact, request_contact=True)]
],
resize_keyboard=True
).row(KeyboardButton(messages.cancel_message))
continue_btn = ReplyKeyboardMarkup([[KeyboardButton(messages.continue_)]], resize_keyboard=True)