init commit
This commit is contained in:
1
app/bot/keyboards/__init__.py
Normal file
1
app/bot/keyboards/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
21
app/bot/keyboards/common.py
Normal file
21
app/bot/keyboards/common.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
|
||||
|
||||
def kb_next_text(draft_id: int):
|
||||
return InlineKeyboardMarkup(
|
||||
[[InlineKeyboardButton("Дальше — текст", callback_data=f"draft_next_text:{draft_id}")]]
|
||||
)
|
||||
|
||||
def kb_confirm(draft_id: int):
|
||||
return InlineKeyboardMarkup(
|
||||
[
|
||||
[
|
||||
InlineKeyboardButton("Отправить", callback_data=f"draft_confirm_send:{draft_id}"),
|
||||
InlineKeyboardButton("Отменить", callback_data=f"draft_cancel:{draft_id}"),
|
||||
]
|
||||
]
|
||||
)
|
||||
|
||||
def kb_choose_chat(draft_id: int, chats: list[tuple[str, int]]):
|
||||
# chats: list of (title, chat_id)
|
||||
rows = [[InlineKeyboardButton(title, callback_data=f"send:{draft_id}:{chat_id}")] for title, chat_id in chats]
|
||||
return InlineKeyboardMarkup(rows) if rows else None
|
||||
Reference in New Issue
Block a user