dev #43

Merged
profitroll merged 49 commits from dev into master 2023-05-02 14:12:58 +03:00
Showing only changes of commit 177d456e79 - Show all commits

View File

@ -66,8 +66,16 @@ async def msg_destination_group(app: Client, msg: Message):
for entity in entities:
if entity.type == MessageEntityType.TEXT_LINK:
analytics_entry["entities"]["links"].append(entity.url)
elif entity.type == MessageEntityType.URL:
analytics_entry["entities"]["links"].append(
text[entity.offset : entity.offset + entity.length]
)
elif entity.type == MessageEntityType.TEXT_MENTION:
analytics_entry["entities"]["mentions"].append(entity.user.id)
elif entity.type == MessageEntityType.MENTION:
analytics_entry["entities"]["mentions"].append(
text[entity.offset : entity.offset + entity.length]
)
lang = Detector(text, quiet=True).language