(items: T[], limit: number, worker: (item: T, index: number) => Promise<R>)
| 705 | const kind = getMediaKind(msg); |
| 706 | return kind === "photo" || kind === "sticker" || kind === "animation" || kind === "document"; |
| 707 | } |
| 708 | |
| 709 | function messageText(msg: Api.Message): string { |
| 710 | const text = (msg as any).message || ""; |
| 711 | if (typeof text === "string" && text.trim()) return text; |
| 712 | const kind = getMediaKind(msg); |
| 713 | if (kind === "photo" || kind === "sticker" || kind === "animation" || kind === "document") return ""; |
| 714 | return mediaFallbackText(msg); |
| 715 | } |
| 716 | |
| 717 | function convertEntities(msg: Api.Message): any[] { |
| 718 | // Telegram puts formatting entities on the message body. For media messages |
| 719 | // the caption IS the body, so the entities already live in msg.entities. |
| 720 | // Some layers use a separate caption_entities field — merge both. |
| 721 | const msgEntities = ((msg as any).entities || []) as any[]; |
no outgoing calls
no test coverage detected