PEP
This commit is contained in:
@@ -31,11 +31,11 @@ def base_menu(cancel=True, skip=False):
|
||||
|
||||
continue_btn = ReplyKeyboardMarkup(
|
||||
[[KeyboardButton(messages.continue_),
|
||||
KeyboardButton(messages.cancel_message)]],
|
||||
KeyboardButton(messages.cancel_message)]],
|
||||
resize_keyboard=True
|
||||
)
|
||||
all_right = ReplyKeyboardMarkup(
|
||||
[[KeyboardButton(messages.all_right_message),
|
||||
KeyboardButton(messages.cancel_message)]],
|
||||
KeyboardButton(messages.cancel_message)]],
|
||||
resize_keyboard=True
|
||||
)
|
||||
|
@@ -2,12 +2,14 @@ from aiogram.types.reply_keyboard import ReplyKeyboardMarkup, KeyboardButton
|
||||
|
||||
from load import messages
|
||||
|
||||
|
||||
def checkout_btn() -> ReplyKeyboardMarkup:
|
||||
return ReplyKeyboardMarkup([[
|
||||
KeyboardButton(messages.all_right_message),
|
||||
KeyboardButton(messages.cancel_message)
|
||||
]], resize_keyboard=True)
|
||||
|
||||
|
||||
def confirm_all_info():
|
||||
markup = ReplyKeyboardMarkup(resize_keyboard=True)
|
||||
markup.add(KeyboardButton(messages.all_right_message))
|
||||
|
@@ -7,16 +7,17 @@ def main_menu(admin=False, operator=False):
|
||||
markup = ReplyKeyboardMarkup(
|
||||
[
|
||||
[
|
||||
KeyboardButton(messages.catalog), # Go to catalog
|
||||
KeyboardButton(messages.cart) # Go to cart
|
||||
KeyboardButton(messages.catalog), # Go to catalog
|
||||
KeyboardButton(messages.cart) # Go to cart
|
||||
]
|
||||
],
|
||||
resize_keyboard=True
|
||||
).add(KeyboardButton(messages.info))
|
||||
if admin == True:
|
||||
|
||||
if admin:
|
||||
markup.add(KeyboardButton(messages.admin_panel))
|
||||
|
||||
if operator == True:
|
||||
if operator:
|
||||
markup.add(KeyboardButton(messages.operator_panel))
|
||||
|
||||
return markup
|
||||
@@ -30,7 +31,8 @@ def cart_btn(is_empty=True):
|
||||
markup.add(KeyboardButton(messages.back))
|
||||
return markup
|
||||
|
||||
back_to_main_menu = ReplyKeyboardMarkup(keyboard=[[KeyboardButton(messages.back)]],resize_keyboard=True)
|
||||
|
||||
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=[
|
||||
|
@@ -2,6 +2,7 @@ from aiogram.types.reply_keyboard import ReplyKeyboardMarkup, KeyboardButton
|
||||
|
||||
from load import messages
|
||||
|
||||
|
||||
def load_info(data:bool = False):
|
||||
markup = ReplyKeyboardMarkup(resize_keyboard=True)
|
||||
if data:
|
||||
|
@@ -3,22 +3,20 @@ from aiogram.types.inline_keyboard import InlineKeyboardMarkup, InlineKeyboardBu
|
||||
from load import messages
|
||||
|
||||
|
||||
def item_list(item=0, items:int=1, user_count:int=1) -> InlineKeyboardMarkup:
|
||||
def item_list(item: int = 0, items: int = 1, user_count: int = 1) -> InlineKeyboardMarkup:
|
||||
markup = InlineKeyboardMarkup()
|
||||
default = [
|
||||
InlineKeyboardButton(user_count, callback_data='null')
|
||||
InlineKeyboardButton(str(user_count), callback_data='null')
|
||||
]
|
||||
back = ['⬅️', f"adm_prev|{item-1}|{user_count-1}"]
|
||||
next = ['➡️', f"adm_next|{item+1}|{user_count+1}"]
|
||||
|
||||
|
||||
if items < 1 or item >= items:
|
||||
next = [" ", "null"]
|
||||
|
||||
if item == 0:
|
||||
back = [" ", "null"]
|
||||
|
||||
|
||||
default.append(InlineKeyboardButton(next[0], callback_data=next[1]))
|
||||
|
||||
markup.add(InlineKeyboardButton(back[0], callback_data=back[1]), *default)
|
||||
|
@@ -1,24 +1,23 @@
|
||||
from aiogram.types.inline_keyboard import InlineKeyboardButton, InlineKeyboardMarkup
|
||||
from load import messages
|
||||
|
||||
def item_list(item=0, items:int=1, user_count:int=1) -> InlineKeyboardMarkup:
|
||||
|
||||
def item_list(item: int = 0, items: int = 1, user_count: int = 1) -> InlineKeyboardMarkup:
|
||||
markup = InlineKeyboardMarkup()
|
||||
default = [
|
||||
InlineKeyboardButton(user_count, callback_data='null')
|
||||
InlineKeyboardButton(str(user_count), callback_data='null')
|
||||
]
|
||||
back = ['⬅️', f"admin_prev|{item-1}|{user_count-1}"]
|
||||
next = ['➡️', f"admin_next|{item+1}|{user_count+1}"]
|
||||
|
||||
|
||||
if items < 1 or item >= items:
|
||||
next = [" ", "null"]
|
||||
|
||||
if item == 0:
|
||||
back = [" ", "null"]
|
||||
|
||||
|
||||
default.append(InlineKeyboardButton(next[0], callback_data=next[1]))
|
||||
|
||||
markup.add(InlineKeyboardButton(back[0], callback_data=back[1]), *default)
|
||||
markup.row(InlineKeyboardButton(messages.del_admin, callback_data=f"delete_admin|{item}"))
|
||||
return markup
|
||||
return markup
|
||||
|
@@ -2,15 +2,15 @@ from aiogram.types.inline_keyboard import InlineKeyboardMarkup, InlineKeyboardBu
|
||||
|
||||
from load import messages
|
||||
|
||||
def cart_list(item=0, items:int=1) -> InlineKeyboardMarkup:
|
||||
|
||||
def cart_list(item:int = 0, items: int = 1) -> InlineKeyboardMarkup:
|
||||
markup = InlineKeyboardMarkup()
|
||||
default = [
|
||||
InlineKeyboardButton(item+1, callback_data='null')
|
||||
InlineKeyboardButton(str(item+1), callback_data='null')
|
||||
]
|
||||
back = ['⬅️', f"cart_prev|{item-1}"]
|
||||
next = ['➡️', f"cart_next|{item+1}"]
|
||||
|
||||
|
||||
if items < 1 or item >= items:
|
||||
next = [" ", "null"]
|
||||
|
||||
|
@@ -3,15 +3,14 @@ from aiogram.types.inline_keyboard import InlineKeyboardMarkup, InlineKeyboardBu
|
||||
from load import messages
|
||||
|
||||
|
||||
def item_list(item=0, items:int=1, user_count:int=1) -> InlineKeyboardMarkup:
|
||||
def item_list(item: int = 0, items: int = 1, user_count: int = 1) -> InlineKeyboardMarkup:
|
||||
markup = InlineKeyboardMarkup()
|
||||
default = [
|
||||
InlineKeyboardButton(user_count, callback_data='null')
|
||||
InlineKeyboardButton(str(user_count), callback_data='null')
|
||||
]
|
||||
back = ['⬅️', f"prev|{item-1}|{user_count-1}"]
|
||||
next = ['➡️', f"next|{item+1}|{user_count+1}"]
|
||||
|
||||
|
||||
if items < 1 or item >= items:
|
||||
next = [" ", "null"]
|
||||
|
||||
@@ -22,4 +21,4 @@ def item_list(item=0, items:int=1, user_count:int=1) -> InlineKeyboardMarkup:
|
||||
|
||||
markup.add(InlineKeyboardButton(back[0], callback_data=back[1]), *default)
|
||||
markup.row(InlineKeyboardButton(messages.add_to_cart, callback_data=f"add_to_cart|{item}"))
|
||||
return markup
|
||||
return markup
|
||||
|
@@ -1,15 +1,14 @@
|
||||
from aiogram.types.inline_keyboard import InlineKeyboardMarkup, InlineKeyboardButton
|
||||
|
||||
|
||||
def cart_list(item=0, items:int=1) -> InlineKeyboardMarkup:
|
||||
def cart_list(item: int = 0, items: int = 1) -> InlineKeyboardMarkup:
|
||||
markup = InlineKeyboardMarkup()
|
||||
default = [
|
||||
InlineKeyboardButton(item+1, callback_data='null')
|
||||
InlineKeyboardButton(str(item+1), callback_data='null')
|
||||
]
|
||||
back = ['⬅️', f"cart_prev|{item-1}"]
|
||||
next = ['➡️', f"cart_next|{item+1}"]
|
||||
|
||||
|
||||
if items < 1 or item >= items:
|
||||
next = [" ", "null"]
|
||||
|
||||
|
Reference in New Issue
Block a user