| 499 | indices.push(idx); |
| 500 | } else { |
| 501 | invalid.push(i.trim()); |
| 502 | } |
| 503 | } catch (error) { |
| 504 | invalid.push(i.trim()); |
| 505 | } |
| 506 | } |
| 507 | |
| 508 | return { indices, invalid }; |
| 509 | } |
| 510 | |
| 511 | function getMediaType(message: any): string { |
| 512 | if (message.photo) return "photo"; |
| 513 | if (message.document) return "document"; |
| 514 | if (message.video) return "video"; |
| 515 | if (message.sticker) return "sticker"; |
| 516 | if (message.animation) return "animation"; |
| 517 | if (message.voice) return "voice"; |
| 518 | if (message.audio) return "audio"; |
| 519 | return "text"; |
| 520 | } |
| 521 | |
| 522 | type TimerHandle = ReturnType<typeof setTimeout>; |
| 523 | |
| 524 | function isAbortError(error: unknown): boolean { |
| 525 | return error instanceof Error && error.name === "AbortError"; |