(target: TargetRecord)
| 391 | } |
| 392 | |
| 393 | function getTargetLookup(target: TargetRecord): any { |
| 394 | if (target.chatId) { |
| 395 | const num = Number(target.chatId); |
| 396 | if (Number.isFinite(num)) return num; |
| 397 | try { |
| 398 | return BigInt(target.chatId); |
| 399 | } catch {} |
| 400 | return target.chatId; |
| 401 | } |
| 402 | return target.target; |
| 403 | } |
| 404 | |
| 405 | function getRpcErrorMessage(error: any): string { |
| 406 | if (!error) return ""; |