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

Function toTargetChat

admin_board/admin_board.ts:326–335  ·  view source on GitHub ↗
(entity: Api.Chat | Api.Channel)

Source from the content-addressed store, hash-verified

324
325async function resolveTargetChat(
326 msg: Api.Message,
327 rawTarget?: string,
328): Promise<TargetChat> {
329 const client = await getGlobalClient();
330 if (!client) throw new Error("Telegram 客户端未初始化");
331
332 if (!rawTarget) {
333 const entity = await msg.getChat();
334 if (!(entity instanceof Api.Chat || entity instanceof Api.Channel)) {
335 throw new Error("当前对话不是群组、超级群或频道");
336 }
337 return toTargetChat(entity);
338 }

Callers 1

resolveTargetChatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected