MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / resolveChatTarget

Function resolveChatTarget

biko/biko.ts:163–180  ·  view source on GitHub ↗
(
  client: any,
  raw: string,
  label: string,
)

Source from the content-addressed store, hash-verified

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
175async 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 }

Callers 1

BikoPluginClass · 0.85

Calls 3

buildEntityDisplayFunction · 0.85
extractErrorMessageFunction · 0.70

Tested by

no test coverage detected