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

Method chunkMentions

atadmins/atadmins.ts:96–113  ·  view source on GitHub ↗
(mentions: string[], header: string, maxLen = 3500, maxCount = 25)

Source from the content-addressed store, hash-verified

94 let count = 0;
95 for (const m of mentions) {
96 const toAdd = (count === 0 ? "" : " , ") + m;
97 if (count >= maxCount || (current.length + toAdd.length) > maxLen) {
98 chunks.push(current);
99 current = header + m; // 新开一条
100 count = 1;
101 } else {
102 current += toAdd;
103 count++;
104 }
105 }
106 if (count > 0) chunks.push(current);
107 return chunks;
108 }
109
110 private async handleAtAdmins(msg: Api.Message, args: string[]): Promise<void> {
111 const client = await getGlobalClient();
112 if (!client) {
113 await msg.edit({ text: "❌ 客户端未初始化", parseMode: "html" });
114 return;
115 }
116

Callers 1

handleAtAdminsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected