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

Function generateBasicSummary

scripts/commit-summary.js:275–324  ·  view source on GitHub ↗
(commitsByRepo)

Source from the content-addressed store, hash-verified

273
274// 生成基础摘要
275function generateBasicSummary(commitsByRepo) {
276 let basicSummary = '';
277 const allPluginGroups = {};
278 const allCoreUpdates = [];
279
280 for (const [repoName, commits] of Object.entries(commitsByRepo)) {
281 if (commits.length === 0) continue;
282
283 const { pluginGroups, coreUpdates } = groupCommitsByFeature(commits);
284
285 Object.entries(pluginGroups).forEach(([plugin, descriptions]) => {
286 if (!allPluginGroups[plugin]) {
287 allPluginGroups[plugin] = [];
288 }
289 allPluginGroups[plugin].push(...descriptions);
290 });
291
292 allCoreUpdates.push(...coreUpdates);
293 }
294
295 if (Object.keys(allPluginGroups).length > 0) {
296 basicSummary += '🔌 插件更新\n';
297
298 const sortedPlugins = Object.keys(allPluginGroups).sort();
299 sortedPlugins.forEach(plugin => {
300 const uniqueDescriptions = [...new Set(allPluginGroups[plugin])];
301 if (uniqueDescriptions.length === 1) {
302 basicSummary += `• ${plugin}: ${uniqueDescriptions[0]}\n`;
303 } else {
304 basicSummary += `• ${plugin}:\n`;
305 uniqueDescriptions.forEach(desc => {
306 basicSummary += ` - ${desc}\n`;
307 });
308 }
309 });
310
311 basicSummary += '\n';
312 }
313
314 if (allCoreUpdates.length > 0) {
315 basicSummary += '🏗️ 本体更新\n';
316 const uniqueCoreUpdates = [...new Set(allCoreUpdates)];
317 uniqueCoreUpdates.forEach(desc => {
318 basicSummary += `• ${desc}\n`;
319 });
320 basicSummary += '\n';
321 }
322
323 return basicSummary;
324}
325
326// 发送到 Telegram
327function sendToTelegram(text) {

Callers 1

mainFunction · 0.85

Calls 1

groupCommitsByFeatureFunction · 0.85

Tested by

no test coverage detected