| 660 | } |
| 661 | |
| 662 | private fuzzyMatch(text: string, query: string): boolean { |
| 663 | if (text.includes(query)) return true; |
| 664 | const queryParts = query.split(' ').filter(part => part.length > 0); |
| 665 | const textParts = text.split(' '); |
| 666 | |
| 667 | if (queryParts.length === 1 && /[a-z]+\s*\d+/i.test(query)) { |
| 668 | if (text.replace(/\s+/g, '').includes(query.replace(/\s+/g, ''))) return true; |
| 669 | } |
| 670 | |
| 671 | return queryParts.every(queryPart => textParts.some(textPart => textPart.includes(queryPart))); |
| 672 | } |
| 673 | |
| 674 | private isAdContent(message: Api.Message): boolean { |
| 675 | const text = (message.text || message.message || "").toLowerCase(); |