ShopBot/keyboard/default/admin/main_menu.py

42 lines
1.2 KiB
Python
Raw Normal View History

2022-06-04 22:02:51 +03:00
from aiogram.types.reply_keyboard import ReplyKeyboardMarkup, KeyboardButton
from load import messages
from utils.json import permission
def main_menu():
markup = ReplyKeyboardMarkup(resize_keyboard=True)
markup.add(KeyboardButton(messages.add_post), KeyboardButton(messages.delete_post))
admin_control = []
if permission.can_admin_add_admins:
admin_control.append(KeyboardButton(messages.add_admin))
if permission.can_admin_del_admins:
admin_control.append(KeyboardButton(messages.del_admin))
if admin_control:
markup.add(*admin_control)
markup.add(KeyboardButton(messages.back))
return markup
def base_menu(cancel=True, skip=False):
markup = ReplyKeyboardMarkup(resize_keyboard=True)
if cancel:
markup.row(KeyboardButton(messages.cancel_message))
if skip:
markup.row(KeyboardButton(messages.skip_message))
return markup
continue_btn = ReplyKeyboardMarkup(
[[KeyboardButton(messages.continue_),
KeyboardButton(messages.cancel_message)]],
resize_keyboard=True
)
all_right = ReplyKeyboardMarkup(
[[KeyboardButton(messages.all_right_message),
KeyboardButton(messages.cancel_message)]],
resize_keyboard=True
)