64 lines
1.6 KiB
Python
64 lines
1.6 KiB
Python
|
from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup
|
|||
|
from aiogram.utils.keyboard import InlineKeyboardBuilder
|
|||
|
from aiogram.fsm.state import StatesGroup, State
|
|||
|
|
|||
|
|
|||
|
class SendState(StatesGroup):
|
|||
|
words = State()
|
|||
|
|
|||
|
|
|||
|
send_words_text = """
|
|||
|
Отправь список слов по одному или столбцом
|
|||
|
"""
|
|||
|
|
|||
|
success_text = """
|
|||
|
Слова {action}!
|
|||
|
"""
|
|||
|
|
|||
|
not_success_remove_text = """
|
|||
|
Что-то пошло не так. Не удалил слова:
|
|||
|
|
|||
|
{words}
|
|||
|
"""
|
|||
|
|
|||
|
|
|||
|
def send_words_ikb() -> InlineKeyboardMarkup:
|
|||
|
"""
|
|||
|
-⬅️ Назад
|
|||
|
:return: объект клавиатуры для параметра reply_markup
|
|||
|
"""
|
|||
|
builder = InlineKeyboardBuilder()
|
|||
|
builder.add(
|
|||
|
InlineKeyboardButton(
|
|||
|
text='⬅️ Назад',
|
|||
|
callback_data='come_back_ban_words'
|
|||
|
)
|
|||
|
)
|
|||
|
builder.adjust(1)
|
|||
|
return builder.as_markup()
|
|||
|
|
|||
|
|
|||
|
def actions_ikb() -> InlineKeyboardMarkup:
|
|||
|
"""
|
|||
|
-➕ Добавить
|
|||
|
-➖ Удалить
|
|||
|
-⬅️ Назад
|
|||
|
:return: объект клавиатуры для параметра reply_markup
|
|||
|
"""
|
|||
|
builder = InlineKeyboardBuilder()
|
|||
|
builder.add(
|
|||
|
InlineKeyboardButton(
|
|||
|
text='➕ Добавить',
|
|||
|
callback_data='ban_words_action_add'
|
|||
|
),
|
|||
|
InlineKeyboardButton(
|
|||
|
text='➖ Удалить',
|
|||
|
callback_data='ban_words_action_remove'
|
|||
|
),
|
|||
|
InlineKeyboardButton(
|
|||
|
text='⬅️ Назад',
|
|||
|
callback_data='come_back_menu'
|
|||
|
)
|
|||
|
)
|
|||
|
builder.adjust(1)
|
|||
|
return builder.as_markup()
|