()
| 423 | |
| 424 | private parseMessageLink(link: string): { chatId: string; messageId: number } | null { |
| 425 | const cleanLink = link.split('?')[0]; |
| 426 | |
| 427 | const patterns = [ |
| 428 | /(?:https?:\/\/)?t\.me\/c\/(-?\d+)\/(\d+)/, |
| 429 | /(?:https?:\/\/)?t\.me\/([a-zA-Z0-9_]+)\/(\d+)/, |
| 430 | ]; |
| 431 | |
| 432 | for (const pattern of patterns) { |
| 433 | const match = cleanLink.match(pattern); |
| 434 | if (match) { |
| 435 | let chatId = match[1]; |
no test coverage detected