fix: send posts as a single media message with text caption instead of splitting into two messages
This commit is contained in:
@@ -370,7 +370,7 @@ class TelegramPoster:
|
||||
if not media_items:
|
||||
return await self.send_text(text)
|
||||
|
||||
first_caption = text if len(text) <= self.caption_limit else self.overflow_caption[: self.caption_limit]
|
||||
first_caption = text[: self.caption_limit]
|
||||
first = media_items[: self.media_group_max_items]
|
||||
message_ids.extend(await self.send_media_items(first, first_caption))
|
||||
if self.send_delay_sec:
|
||||
@@ -383,8 +383,6 @@ class TelegramPoster:
|
||||
if self.send_delay_sec:
|
||||
await asyncio.sleep(self.send_delay_sec)
|
||||
|
||||
if len(text) > self.caption_limit:
|
||||
message_ids.extend(await self.send_text(text))
|
||||
return message_ids
|
||||
|
||||
async def mark_published(self, post_id: int, message_ids: list[int]) -> None:
|
||||
|
||||
Reference in New Issue
Block a user