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

Class SummaryPlugin

sum/sum.ts:922–1860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

920• <code>${mainPrefix}sum config set timeout &lt;秒数&gt;</code> - 设置AI超时时间(默认60秒)
921• <code>${mainPrefix}sum config set reply on/off</code> - 回复模式(发送新消息,防止被顶走,默认开启)
922• <code>${mainPrefix}sum config set maxoutput &lt;字符数&gt;</code> - 最大输出长度(0不限制,默认不限制)
923• <code>${mainPrefix}sum prompts</code> - 查看推荐提示词
924`;
925
926class SummaryPlugin extends Plugin {
927
928 description: string = `群消息总结插件\n\n${help_text}`;
929
930 cmdHandlers: Record<string, (msg: Api.Message) => Promise<void>> = {
931 sum: async (msg: Api.Message) => {
932 const parts = msg.message?.trim()?.split(/\s+/) || [];
933 const [, sub, ...args] = parts;
934
935 try {
936 // 查看推荐提示词
937 if (sub === "prompts") {
938 const prompts = [
939 {
940 name: "默认总结(HTML折叠版)",
941 prompt: `你是一个群聊/频道消息的专业总结助手。请阅读下面这段「最近消息记录」,用**简洁、结构化的中文**做一个总结。
942
943【重要】输出必须是 Telegram HTML 格式,每个章节使用 <blockquote expandable> 标签包裹实现折叠。
944
945【输入格式说明】
946消息记录末尾有一个「消息中包含的外部链接」部分,格式为:
947资源URL - [查看原消息](Telegram消息链接)
948请直接使用这个部分提供的 URL 和来源链接。
949
950【输出格式要求】
951严格按以下 HTML 结构输出(每个章节都是可折叠的):
952
953<b>主要话题:</b>
954<blockquote expandable>• 话题1
955• 话题2</blockquote>
956
957<b>技术讨论:</b>
958<blockquote expandable>• 技术点1 <a href="https://example.com/source">来源</a>
959• 技术点2</blockquote>
960
961<b>资源分享:</b>
962<blockquote expandable>* 外部链接:
963• 资源说明 <a href="https://example.com/resource">链接</a> - <a href="https://t.me/c/123456789/123">查看原消息</a>
964* 文件分享:
965• 文件名 - <a href="https://t.me/c/123456789/123">查看原消息</a></blockquote>
966
967<b>重要互动:</b>
968<blockquote expandable>• 人物 + 问题/结论 <a href="https://example.com/source">来源</a></blockquote>
969
970<b>零散信息:</b>
971<blockquote expandable>• 备注信息</blockquote>
972
973<b>时间线梳理:</b>
974<blockquote expandable>• 时间 - 事件概述</blockquote>
975
976【HTML 格式规则】
9771. 链接使用 <a href="URL">文本</a> 格式
9782. 标题使用 <b>标题</b> 格式
9793. 每个章节内容用 <blockquote expandable>...</blockquote> 包裹

Callers

nothing calls this directly

Calls 15

getGroupMessagesFunction · 0.85
summarizeMessagesFunction · 0.85
wrapWithSpoilerFunction · 0.85
parseIntervalFunction · 0.85
parseChatIdentifierFunction · 0.85
buildChatLinkFunction · 0.85
executeSummaryFunction · 0.85
errorMethod · 0.80
writeMethod · 0.80
htmlEscapeFunction · 0.70
codeTagFunction · 0.70
toIntFunction · 0.70

Tested by

no test coverage detected