New features
This commit is contained in:
0
keyboard/inline/operator/__init__.py
Normal file
0
keyboard/inline/operator/__init__.py
Normal file
23
keyboard/inline/operator/user.py
Normal file
23
keyboard/inline/operator/user.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from aiogram.types.inline_keyboard import InlineKeyboardButton, InlineKeyboardMarkup
|
||||
from load import messages
|
||||
|
||||
|
||||
def item_list(item: int = 0, items: int = 1, user_count: int = 1) -> InlineKeyboardMarkup:
|
||||
markup = InlineKeyboardMarkup()
|
||||
default = [
|
||||
InlineKeyboardButton(str(user_count), callback_data='null')
|
||||
]
|
||||
back = ['⬅️', f"operator_prev|{item-1}|{user_count-1}"]
|
||||
next = ['➡️', f"operator_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_operator, callback_data=f"delete_operator|{item}"))
|
||||
return markup
|
Reference in New Issue
Block a user