(str: string)
| 166 | ]) |
| 167 | |
| 168 | function isPureEmoji(str: string): boolean { |
| 169 | const stripped = str |
| 170 | .replace(/\p{Emoji_Presentation}/gu, '') |
| 171 | .replace(/\p{Extended_Pictographic}/gu, '') |
| 172 | .replace(/\u200d/g, '') |
| 173 | .replace(/\ufe0f/g, '') |
| 174 | .replace(/\u20e3/g, '') |
| 175 | .replace(/\s/g, '') |
| 176 | return stripped.length === 0 |
| 177 | } |
| 178 | |
| 179 | function applyMergeConsecutive<T extends PreprocessableMessage>(messages: T[], windowSeconds: number): T[] { |
| 180 | if (messages.length <= 1) return messages |