chat_moderator_bot/templates/ban_words.py
2024-07-17 23:35:45 +03:00

64 lines
1.6 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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()