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)
|
2022-06-16 00:32:17 +03:00
|
|
|
markup.add(KeyboardButton(messages.add_operator), KeyboardButton(messages.del_operator))
|
2022-06-04 22:02:51 +03:00
|
|
|
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_),
|
2022-06-05 15:02:41 +03:00
|
|
|
KeyboardButton(messages.cancel_message)]],
|
2022-06-04 22:02:51 +03:00
|
|
|
resize_keyboard=True
|
|
|
|
)
|
|
|
|
all_right = ReplyKeyboardMarkup(
|
|
|
|
[[KeyboardButton(messages.all_right_message),
|
2022-06-05 15:02:41 +03:00
|
|
|
KeyboardButton(messages.cancel_message)]],
|
2022-06-04 22:02:51 +03:00
|
|
|
resize_keyboard=True
|
|
|
|
)
|