fix(parse-modes): negative access hashes for permanent mentions

This commit is contained in:
teidesu 2021-04-25 13:34:06 +03:00
parent f55d099b5f
commit dea02c9c39
2 changed files with 2 additions and 2 deletions

View file

@ -3,7 +3,7 @@ import { tl } from '@mtcute/tl'
import { Parser } from 'htmlparser2' import { Parser } from 'htmlparser2'
import bigInt from 'big-integer' import bigInt from 'big-integer'
const MENTION_REGEX = /^tg:\/\/user\?id=(\d+)(?:&hash=([0-9a-fA-F]+)(?:&|$)|&|$)/ const MENTION_REGEX = /^tg:\/\/user\?id=(\d+)(?:&hash=(-?[0-9a-fA-F]+)(?:&|$)|&|$)/
export namespace HtmlMessageEntityParser { export namespace HtmlMessageEntityParser {
/** /**

View file

@ -2,7 +2,7 @@ import type { IMessageEntityParser, MessageEntity } from '@mtcute/client'
import { tl } from '@mtcute/tl' import { tl } from '@mtcute/tl'
import bigInt from 'big-integer' import bigInt from 'big-integer'
const MENTION_REGEX = /^tg:\/\/user\?id=(\d+)(?:&hash=([0-9a-fA-F]+)(?:&|$)|&|$)/ const MENTION_REGEX = /^tg:\/\/user\?id=(\d+)(?:&hash=(-?[0-9a-fA-F]+)(?:&|$)|&|$)/
const TAG_BOLD = '**' const TAG_BOLD = '**'
const TAG_ITALIC = '__' const TAG_ITALIC = '__'