| 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 | |