42 lines
1.4 KiB
Python
42 lines
1.4 KiB
Python
from aiogram.types.reply_keyboard import ReplyKeyboardMarkup, KeyboardButton
|
|
|
|
from load import messages
|
|
|
|
|
|
def main_menu(admin=False, operator=False):
|
|
markup = ReplyKeyboardMarkup(
|
|
[
|
|
[
|
|
KeyboardButton(messages.catalog), # Go to catalog
|
|
KeyboardButton(messages.cart) # Go to cart
|
|
]
|
|
],
|
|
resize_keyboard=True
|
|
).add(KeyboardButton(messages.info))
|
|
if admin == True:
|
|
markup.add(KeyboardButton(messages.admin_panel))
|
|
|
|
if operator == True:
|
|
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
|
|
|
|
back_to_main_menu = ReplyKeyboardMarkup(keyboard=[[KeyboardButton(messages.back)]],resize_keyboard=True)
|
|
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)
|