UdoChudo ab33329e31 feat: (tg message composer) improve composing message now have more usefull information
Add event duration time
Add event start date and time
Add event resolved date and time
Add event chart link

Signed-off-by: UdoChudo <stream@udochudo.ru>
2025-06-27 20:37:06 +05:00

18 lines
540 B
Python
Raw 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 typing import Optional
from telebot.types import InlineKeyboardMarkup, InlineKeyboardButton
def create_link_button(link: Optional[str]) -> Optional[InlineKeyboardMarkup]:
"""
Создаёт InlineKeyboardMarkup с кнопкой-ссылкой.
Если ссылка не передана, возвращает None.
"""
if not link:
return None
markup = InlineKeyboardMarkup()
button = InlineKeyboardButton(text="Открыть график", url=link)
markup.add(button)
return markup