From bc6e14b42dc527bb79258bc9ae6e462257072e30 Mon Sep 17 00:00:00 2001 From: Ilya Frolov <57362643+czvelox@users.noreply.github.com> Date: Mon, 24 Feb 2025 13:46:08 +0000 Subject: [PATCH] Fix parse invite link Invitation links to the channel start with t.me/+XXX , which is why the regular expression does not skip the entity and the link disappears from the message --- gramjs/client/messageParse.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gramjs/client/messageParse.ts b/gramjs/client/messageParse.ts index 085c2496..fedeccac 100644 --- a/gramjs/client/messageParse.ts +++ b/gramjs/client/messageParse.ts @@ -69,7 +69,7 @@ export async function _parseMessageText( for (let i = msgEntities.length - 1; i >= 0; i--) { const e = msgEntities[i]; if (e instanceof Api.MessageEntityTextUrl) { - const m = /^@|\+|tg:\/\/user\?id=(\d+)/.exec(e.url); + const m = /^@|tg:\/\/user\?id=(\d+)/.exec(e.url); if (m) { const userIdOrUsername = m[1] ? Number(m[1]) : e.url; const isMention = await _replaceWithMention(