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

Function normalizeId

uai/uai.ts:199–210  ·  view source on GitHub ↗
(id: any)

Source from the content-addressed store, hash-verified

197 if (typeof id === "object") {
198 // 尝试获取 userId、channelId 或 value
199 const val = id.userId || id.channelId || id.chatId || id.value || id;
200 return normalizeId(val);
201 }
202 return String(id);
203}
204
205async function collectMessages(
206 chatPeerId: any, // msg.peerId
207 filterSenderId: string | null, // senderId 用于过滤(数字形式的 userId)
208 limit: { type: "count"; value: number } | { type: "time"; seconds: number } | { type: "today" }
209): Promise<MessageData[]> {
210 const client = await getGlobalClient();
211 if (!client) throw new Error("客户端未初始化");
212
213 const messages: MessageData[] = [];

Callers 1

collectMessagesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected