(entityOrId: any)
| 470 | const rawId = extractIdString(entityOrId); |
| 471 | if (rawId.startsWith("-100")) return Number(rawId); |
| 472 | const chatId = Number(rawId); |
| 473 | if (chatId > 1000000000) { |
| 474 | return ensureChannelId(rawId); |
| 475 | } |
| 476 | return chatId; |
| 477 | } |
| 478 | } |
| 479 | |
| 480 | function getTargetTypeEmoji(entity: any): string { |
| 481 | if (!entity) return "❓"; |
| 482 | if (entity.className === "User") return entity.bot ? "🤖" : "👤"; |
| 483 | if (entity.className === "Channel") return entity.broadcast ? "📢" : "👥"; |
| 484 | if (entity.className === "Chat") return "👥"; |
| 485 | return "❓"; |
| 486 | } |
| 487 | |
| 488 | function parseIndices( |
| 489 | indicesStr: string, |
| 490 | total: number |
| 491 | ): { indices: number[]; invalid: string[] } { |
| 492 | const indices: number[] = []; |
| 493 | const invalid: string[] = []; |
| 494 |
no test coverage detected