( client: any, raw: string, label: string, )
| 161 | try { |
| 162 | const entity = await resolveEntityWithFallback(client, raw); |
| 163 | return { |
| 164 | raw, |
| 165 | entity, |
| 166 | display: buildEntityDisplay(entity, raw), |
| 167 | }; |
| 168 | } catch (error) { |
| 169 | throw new Error( |
| 170 | `${label}解析失败: ${raw}\n原因: ${extractErrorMessage(error)}`, |
| 171 | ); |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | async function resolveSourceUser( |
| 176 | client: any, |
| 177 | raw: string, |
| 178 | ): Promise<ResolvedSourceUser> { |
| 179 | try { |
| 180 | const entity = await resolveEntityWithFallback(client, raw); |
| 181 | if (!(entity instanceof Api.User)) { |
| 182 | throw new Error("解析结果不是用户实体"); |
| 183 | } |
no test coverage detected