Update PostParser to classify unknown posts with a new emoji and enhance RSS generator to ignore new chat title events
This commit is contained in:
+1
-1
@@ -137,7 +137,7 @@ class PostParser:
|
||||
if hasattr(message.document, 'mime_type') and message.document.mime_type == 'application/pdf': return "📄 Document"
|
||||
else: return "📎 Document"
|
||||
elif message.web_page: return "🔗 Web link"
|
||||
return "📷 Media post"
|
||||
return "🤷♂️ Unknown post"
|
||||
|
||||
# Remove URLs
|
||||
text = re.sub(r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', '', text)
|
||||
|
||||
@@ -77,6 +77,7 @@ async def _create_messages_groups(messages):
|
||||
if message.service:
|
||||
if 'PINNED_MESSAGE' in str(message.service): continue
|
||||
if 'NEW_CHAT_PHOTO' in str(message.service): continue
|
||||
if 'NEW_CHAT_TITLE' in str(message.service): continue
|
||||
|
||||
if message.media_group_id:
|
||||
if message.media_group_id not in media_groups:
|
||||
|
||||
Reference in New Issue
Block a user