diff --git a/modules/handlers/analytics_group.py b/modules/handlers/analytics_group.py index 0c8db51..daae591 100644 --- a/modules/handlers/analytics_group.py +++ b/modules/handlers/analytics_group.py @@ -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