feat: ai letter + disabled fl

This commit is contained in:
2026-07-17 12:21:53 +07:00
parent b906825134
commit 3fe870024d
13 changed files with 1610 additions and 24 deletions

View File

@@ -1,7 +1,7 @@
from __future__ import annotations
from aiogram import Bot
from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup
from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message
from app.models import Offer
@@ -11,12 +11,12 @@ class TelegramPublisher:
self._bot = bot
self._channel_id = channel_id
async def publish_offer(self, offer: Offer) -> None:
await self._bot.send_message(
async def publish_offer(self, offer: Offer) -> Message:
return await self._bot.send_message(
chat_id=self._channel_id,
text=_format_offer_message(offer),
disable_web_page_preview=True,
reply_markup=_build_delete_markup(),
reply_markup=_build_offer_markup(),
)
@@ -39,9 +39,10 @@ def _format_offer_message(offer: Offer) -> str:
)
def _build_delete_markup() -> InlineKeyboardMarkup:
def _build_offer_markup() -> InlineKeyboardMarkup:
return InlineKeyboardMarkup(
inline_keyboard=[
[InlineKeyboardButton(text="❌", callback_data="delete_post")]
[InlineKeyboardButton(text="Принять", callback_data="accept_offer")],
[InlineKeyboardButton(text="❌", callback_data="delete_post")],
]
)