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

Method doCs

fbi/fbi.ts:273–311  ·  view source on GitHub ↗
(msg: Api.Message, args: string[])

Source from the content-addressed store, hash-verified

271 } finally {
272 this.cacheReady = true;
273 }
274 }
275
276 /* ====== router ====== */
277
278 private async onCmd(msg: Api.Message): Promise<void> {
279 const parts = msg.text?.trim().split(/\s+/) || [];
280 const sub = parts[1]?.toLowerCase();
281 const args = parts.slice(2);
282
283 if (!this.ready) {
284 await msg.edit({ text: "⏳ FBI 正在初始化,请稍后再试。", parseMode: "html" });
285 return;
286 }
287
288 try {
289 switch (sub) {
290 case "det": return this.doDet(msg, args);
291 case "sur": return this.doSur(msg, args);
292 case "loc": return this.doLoc(msg, args);
293 case "obs": return this.doObs(msg, args);
294 case "ssv": return this.doSsv(msg);
295 case "cache": return this.doCache(msg, args);
296 default: { await msg.edit({ text: HELP, parseMode: "html" }); return; }
297 }
298 } catch (e: any) {
299 await msg.edit({ text: `❌ ${htmlEsc(e.message || "未知错误")}`, parseMode: "html" });
300 }
301 }
302
303 /* ====== target resolver ====== */
304
305 private async resolveTarget(msg: Api.Message, args: string[]): Promise<{ id: string; name: string } | null> {
306 const cl = await getGlobalClient();
307 if (!cl) return null;
308 let targetId: string | undefined;
309 let name = "";
310
311 if (args.length) {
312 const raw = args[0];
313 try {
314 const e = entityFields(await cl.getEntity(raw));

Callers 1

onCmdMethod · 0.95

Calls 7

resolveTargetMethod · 0.95
sendReplyMethod · 0.95
htmlEscFunction · 0.85
peelChatIdFunction · 0.85
editMethod · 0.45
deleteMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected