35 lines
1.0 KiB
Python
35 lines
1.0 KiB
Python
from typing import Optional
|
|
from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup
|
|
from aiogram.utils.keyboard import InlineKeyboardBuilder
|
|
|
|
placeholder_kb = InlineKeyboardBuilder(
|
|
[[InlineKeyboardButton(text="🍃", callback_data="...")]]
|
|
).as_markup()
|
|
|
|
|
|
def customer_contacts(
|
|
user_id: int, has_mention: bool, mention: Optional[str] = None
|
|
) -> InlineKeyboardMarkup:
|
|
btns: list[list[InlineKeyboardButton]] = []
|
|
(
|
|
btns.append(
|
|
[InlineKeyboardButton(text="👤 Перейти", url=f"https://t.me/{mention}")]
|
|
)
|
|
if has_mention
|
|
else None
|
|
)
|
|
btns.append(
|
|
[
|
|
InlineKeyboardButton(text="✍️", url=f"tg://openmessage?user_id={user_id}"),
|
|
InlineKeyboardButton(text="✍️", url=f"tg://user?id={user_id}"),
|
|
]
|
|
)
|
|
|
|
return InlineKeyboardBuilder(btns).as_markup()
|
|
|
|
|
|
def payment_link(url: str) -> InlineKeyboardMarkup:
|
|
return InlineKeyboardBuilder(
|
|
[[InlineKeyboardButton(text="💸 Оплатить", url=url)]]
|
|
).as_markup()
|