forked from FOSS/ASF-Control-Bot
refactor: balance handling and upload processing
This commit is contained in:
+2
-8
@@ -6,12 +6,11 @@ from bot.config import ADMIN_ID
|
||||
|
||||
def main_keyboard(user_id: int | None = None) -> InlineKeyboardMarkup:
|
||||
keyboard = [
|
||||
[InlineKeyboardButton(text="👤 Профиль", callback_data="profile")],
|
||||
[InlineKeyboardButton(text="🤖 Боты", callback_data="bots")],
|
||||
[InlineKeyboardButton(text="🔑 Активация ключей", callback_data="redeem_keys")],
|
||||
]
|
||||
|
||||
profile_index = -1 if user_id == ADMIN_ID else 0
|
||||
|
||||
if user_id == ADMIN_ID:
|
||||
keyboard.insert(
|
||||
0,
|
||||
@@ -28,11 +27,6 @@ def main_keyboard(user_id: int | None = None) -> InlineKeyboardMarkup:
|
||||
],
|
||||
)
|
||||
|
||||
keyboard.insert(
|
||||
profile_index,
|
||||
[InlineKeyboardButton(text="👤 Профиль", callback_data="profile")],
|
||||
)
|
||||
|
||||
return InlineKeyboardMarkup(inline_keyboard=keyboard)
|
||||
|
||||
|
||||
@@ -102,7 +96,7 @@ def bots_keyboard(bots: list[tuple[int, str, dict]]) -> InlineKeyboardMarkup:
|
||||
keyboard.extend(
|
||||
[
|
||||
[InlineKeyboardButton(text="⬆️ Загрузить конфиг", callback_data="upload")],
|
||||
[InlineKeyboardButton(text="🔙 Назад", callback_data="admin_panel")],
|
||||
[InlineKeyboardButton(text="🔙 Назад", callback_data="back")],
|
||||
]
|
||||
)
|
||||
return InlineKeyboardMarkup(inline_keyboard=keyboard)
|
||||
|
||||
Reference in New Issue
Block a user