Skip to content

Commit

Permalink
Fix parse invite link
Browse files Browse the repository at this point in the history
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
  • Loading branch information
czvelox committed Feb 24, 2025
1 parent 324820f commit bc6e14b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gramjs/client/messageParse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit bc6e14b

Please sign in to comment.