add formating
This commit is contained in:
@@ -7,6 +7,7 @@ from telegram.ext import Application
|
||||
|
||||
from .config import REMINDER_POLL_SECONDS
|
||||
from .storage import AssistantStorage
|
||||
from .telegram_utils import escape_markdown_text, markdown_code, send_markdown
|
||||
from .time_utils import format_local_dt, utc_now
|
||||
|
||||
|
||||
@@ -21,12 +22,15 @@ async def reminder_loop(application: Application) -> None:
|
||||
try:
|
||||
due_reminders = storage.due_reminders(utc_now())
|
||||
for reminder in due_reminders:
|
||||
await application.bot.send_message(
|
||||
await send_markdown(
|
||||
application.bot,
|
||||
chat_id=reminder["chat_id"],
|
||||
text=(
|
||||
f"Напоминание #{reminder['id']} "
|
||||
f"({format_local_dt(reminder['remind_at'], tz)}):\n"
|
||||
f"{reminder['text']}"
|
||||
markdown=(
|
||||
f"**⏰ Напоминание "
|
||||
f"{markdown_code('#' + str(reminder['id']))}**\n\n"
|
||||
f"**Время:** "
|
||||
f"{markdown_code(format_local_dt(reminder['remind_at'], tz))}\n"
|
||||
f"**Задача:** {escape_markdown_text(reminder['text'])}"
|
||||
),
|
||||
)
|
||||
storage.mark_reminder_sent(int(reminder["id"]))
|
||||
|
||||
Reference in New Issue
Block a user