(entity: any, fallbackRaw: string)
| 127 | if (entity?.username) parts.push(`@${entity.username}`); |
| 128 | if (entity?.id !== undefined && entity?.id !== null) { |
| 129 | parts.push(String(entity.id)); |
| 130 | } |
| 131 | return parts.join(" ").trim() || fallbackRaw; |
| 132 | } |
| 133 | |
| 134 | async function resolveEntityWithFallback( |
| 135 | client: any, |
| 136 | raw: string, |
| 137 | ): Promise<any> { |
| 138 | const attempts: any[] = [raw]; |
| 139 | if (/^-?\d+$/.test(raw)) { |
| 140 | const numeric = Number(raw); |
| 141 | if (Number.isSafeInteger(numeric)) attempts.push(numeric); |
| 142 | } |
no outgoing calls
no test coverage detected