diff --git a/post_parser.py b/post_parser.py index 59756f7..4520227 100644 --- a/post_parser.py +++ b/post_parser.py @@ -426,7 +426,9 @@ class PostParser: # Check if document is a PDF file if message.media == MessageMediaType.DOCUMENT and hasattr(message.document, 'mime_type') and message.document.mime_type == 'application/pdf': - content_media.append(f'
[PDF-файл]
') + if channel_username.startswith('-100'): tg_link = f"https://t.me/c/{channel_username[4:]}/{message.id}" + else: tg_link = f"https://t.me/{channel_username}/{message.id}" + content_media.append(f'
[PDF-файл]
') elif message.media in [MessageMediaType.PHOTO, MessageMediaType.DOCUMENT]: content_media.append(f'') elif message.media == MessageMediaType.VIDEO: