Spaces:
Sleeping
Sleeping
Update keyboards.py
Browse files- keyboards.py +53 -89
keyboards.py
CHANGED
|
@@ -1,103 +1,67 @@
|
|
| 1 |
-
# keyboards.py
|
| 2 |
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton, ReplyKeyboardMarkup, KeyboardButton
|
| 3 |
-
from aiogram.utils.keyboard import InlineKeyboardBuilder
|
| 4 |
-
|
| 5 |
|
| 6 |
def get_main_menu():
|
| 7 |
-
"""Главное меню
|
| 8 |
-
builder =
|
| 9 |
-
builder.
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
builder.
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
"""Выбор пола"""
|
| 22 |
builder = InlineKeyboardBuilder()
|
| 23 |
-
builder.
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
builder.adjust(2)
|
| 26 |
return builder.as_markup()
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
"""Выбор стиля — 22 варианта"""
|
| 31 |
builder = InlineKeyboardBuilder()
|
| 32 |
-
|
| 33 |
-
# Реализм
|
| 34 |
-
builder.button(text="📸 Фотореализм", callback_data="style_photorealistic")
|
| 35 |
-
builder.button(text="🎯 Гиперреализм", callback_data="style_hyperrealistic")
|
| 36 |
-
builder.button(text="🎬 Кино кадр", callback_data="style_cinematic")
|
| 37 |
-
|
| 38 |
-
# Художественные
|
| 39 |
-
builder.button(text="🎨 Арт", callback_data="style_art")
|
| 40 |
-
builder.button(text="🖼️ Масло", callback_data="style_oil_painting")
|
| 41 |
-
builder.button(text="💧 Акварель", callback_data="style_watercolor")
|
| 42 |
-
builder.button(text="✏️ Скетч", callback_data="style_sketch")
|
| 43 |
-
|
| 44 |
-
# Фантастика
|
| 45 |
-
builder.button(text="🔥 Киберпанк", callback_data="style_cyberpunk")
|
| 46 |
-
builder.button(text="🧙 Фэнтези", callback_data="style_fantasy")
|
| 47 |
-
builder.button(text="🚀 Sci-Fi", callback_data="style_scifi")
|
| 48 |
-
builder.button(text="🌌 Космос", callback_data="style_space")
|
| 49 |
-
|
| 50 |
-
# Стилизации
|
| 51 |
-
builder.button(text="✨ Винтаж", callback_data="style_vintage")
|
| 52 |
-
builder.button(text="🎭 Нуар", callback_data="style_noir")
|
| 53 |
-
builder.button(text="🎪 Поп-арт", callback_data="style_popart")
|
| 54 |
-
builder.button(text="📰 Комикс", callback_data="style_comic")
|
| 55 |
-
|
| 56 |
-
# Аниме/Игры
|
| 57 |
-
builder.button(text="🌸 Аниме", callback_data="style_anime")
|
| 58 |
-
builder.button(text="🎮 3D Render", callback_data="style_3d_render")
|
| 59 |
-
builder.button(text="👾 Пиксель-арт", callback_data="style_pixel_art")
|
| 60 |
-
|
| 61 |
-
# Другие
|
| 62 |
-
builder.button(text="🌅 Импрессионизм", callback_data="style_impressionism")
|
| 63 |
-
builder.button(text="🏛️ Классика", callback_data="style_classical")
|
| 64 |
-
builder.button(text="🎲 Сюрреализм", callback_data="style_surrealism")
|
| 65 |
-
|
| 66 |
-
builder.adjust(2, 2, 2, 2, 2, 2, 2, 1)
|
| 67 |
return builder.as_markup()
|
| 68 |
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
"""Выбор типа кадра"""
|
| 72 |
builder = InlineKeyboardBuilder()
|
| 73 |
-
builder.
|
| 74 |
-
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
return builder.as_markup()
|
| 77 |
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
[
|
| 95 |
-
KeyboardButton(text="📊 Моя статистика"),
|
| 96 |
-
KeyboardButton(text="❓ Помощь"),
|
| 97 |
-
KeyboardButton(text="🤖 О боте")
|
| 98 |
-
]
|
| 99 |
-
],
|
| 100 |
-
resize_keyboard=True, # Кнопки подстраиваются под размер экрана
|
| 101 |
-
one_time_keyboard=False, # Меню не исчезает после нажатия
|
| 102 |
-
input_field_placeholder="Выберите действие 👇" # Подсказка в поле ввода
|
| 103 |
-
)
|
|
|
|
|
|
|
| 1 |
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton, ReplyKeyboardMarkup, KeyboardButton
|
| 2 |
+
from aiogram.utils.keyboard import InlineKeyboardBuilder, ReplyKeyboardBuilder
|
|
|
|
| 3 |
|
| 4 |
def get_main_menu():
|
| 5 |
+
"""Главное меню (ReplyKeyboard)"""
|
| 6 |
+
builder = ReplyKeyboardBuilder()
|
| 7 |
+
builder.row(
|
| 8 |
+
KeyboardButton(text="🎨 Создать фото"),
|
| 9 |
+
KeyboardButton(text="🖼️ С референсами")
|
| 10 |
+
)
|
| 11 |
+
builder.row(
|
| 12 |
+
KeyboardButton(text="📊 Моя статистика"),
|
| 13 |
+
KeyboardButton(text="⚙️ Настройки")
|
| 14 |
+
)
|
| 15 |
+
builder.row(KeyboardButton(text="❓ Помощь"))
|
| 16 |
+
builder.adjust(2, 2, 1)
|
| 17 |
+
return builder.as_markup(resize_keyboard=True)
|
| 18 |
|
| 19 |
+
def get_reference_menu():
|
| 20 |
+
"""Меню выбора референсов (Inline)"""
|
|
|
|
| 21 |
builder = InlineKeyboardBuilder()
|
| 22 |
+
builder.row(
|
| 23 |
+
InlineKeyboardButton(text="📸 Только лицо", callback_data="ref_face_only"),
|
| 24 |
+
InlineKeyboardButton(text="🎨 + Стиль", callback_data="ref_face_style")
|
| 25 |
+
)
|
| 26 |
+
builder.row(
|
| 27 |
+
InlineKeyboardButton(text="🧘 + Поза", callback_data="ref_face_pose"),
|
| 28 |
+
InlineKeyboardButton(text="🖼️ Всё вместе", callback_data="ref_all")
|
| 29 |
+
)
|
| 30 |
+
builder.row(InlineKeyboardButton(text="⬅️ Назад", callback_data="back_to_main"))
|
| 31 |
builder.adjust(2)
|
| 32 |
return builder.as_markup()
|
| 33 |
|
| 34 |
+
def get_progress_keyboard(gen_id: str):
|
| 35 |
+
"""Клавиатура с кнопкой отмены (Inline)"""
|
|
|
|
| 36 |
builder = InlineKeyboardBuilder()
|
| 37 |
+
builder.button(text="❌ Отменить", callback_data=f"cancel_{gen_id}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
return builder.as_markup()
|
| 39 |
|
| 40 |
+
def get_result_keyboard(gen_id: str):
|
| 41 |
+
"""Клавиатура после генерации (Inline)"""
|
|
|
|
| 42 |
builder = InlineKeyboardBuilder()
|
| 43 |
+
builder.row(
|
| 44 |
+
InlineKeyboardButton(text="🔄 Ещё раз", callback_data=f"retry_{gen_id}"),
|
| 45 |
+
InlineKeyboardButton(text="🎨 Другой стиль", callback_data="choose_style")
|
| 46 |
+
)
|
| 47 |
+
builder.row(
|
| 48 |
+
InlineKeyboardButton(text="🏠 В меню", callback_data="back_to_main")
|
| 49 |
+
)
|
| 50 |
return builder.as_markup()
|
| 51 |
|
| 52 |
+
def get_style_menu():
|
| 53 |
+
"""Меню выбора стиля (Inline)"""
|
| 54 |
+
builder = InlineKeyboardBuilder()
|
| 55 |
+
styles = [
|
| 56 |
+
("🎬 Кинематографичный", "style_cinematic"),
|
| 57 |
+
("🌟 Портрет", "style_portrait"),
|
| 58 |
+
("🎨 Арт", "style_art"),
|
| 59 |
+
("📸 Реализм", "style_realistic"),
|
| 60 |
+
("🌃 Киберпанк", "style_cyberpunk"),
|
| 61 |
+
("✨ Фэнтези", "style_fantasy"),
|
| 62 |
+
]
|
| 63 |
+
for text, callback in styles:
|
| 64 |
+
builder.button(text=text, callback_data=callback)
|
| 65 |
+
builder.adjust(2)
|
| 66 |
+
builder.button(text="⏭️ Пропустить", callback_data="style_skip")
|
| 67 |
+
return builder.as_markup()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|