-
Notifications
You must be signed in to change notification settings - Fork 1
updt ori #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
updt ori #5
Conversation
* feature:新增表情包制作工具函数 * feature:新增表情包制作工具函数 * fix spell & make lint happy * style and bug 进行一些调整。 * 获取表情包info封装到一个函数 * fix image array bug modified: src/tool/tool_meme.ts * fix: 修复没有正确返回文本的问题 * Update update.ts --------- Co-authored-by: error2913 <2913949387@qq.com>
* feat:添加“在上下文内添加消息时间”和”活跃时间段随机触发“相关逻辑 issue #33 * 尚未完成工作,只是保存一下下 * finish the work * fix: 修复特定情况无法正确构建content * fix: 修复重复触发问题 * fix: 指令解析错误 --------- Co-authored-by: error2913 <2913949387@qq.com>
* 硬!编码所有指令信息 * Update privilege.ts * 哈哈做完啦 * 果然有!!! * feat: 适配了最新依赖 * feat: 合并相同记忆 ( #47 )
* feat:新增获取精华消息列表和删除精华消息工具
* 重构一下,使solve返回`Promise<{ content: string, images: Image[] }>`
* fix: 修复精华消息图片相关
---------
Co-authored-by: error2913 <2913949387@qq.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request refactors the message structure and implements several new features including time display, privilege management, timer improvements, and enhanced tool function support.
Key Changes
- Refactored message structure from
contentArray/msgIdArrayto a unifiedmsgArraycontaining message metadata (ID, timestamp, content) - Implemented comprehensive privilege system with command-specific and session-based permissions
- Enhanced timer functionality with interval and active time timers
- Improved tool function return format to include both content and images
- Added JSON string repair functionality for handling malformed tool function arguments
Reviewed Changes
Copilot reviewed 41 out of 42 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/utils_string.ts | Added MessageSegment interface, fmtDate function, and fixJsonString utility |
| src/utils/utils_message.ts | Refactored message building to use new msgArray structure with timestamps |
| src/utils/utils.ts | Added null handling for transformMsgId and revive utility function |
| src/update.ts | Updated version history and changelog |
| src/tool/*.ts | Updated all tool functions to return {content, images} format |
| src/timer.ts | Converted TimerInfo to class, added interval and active time timer support |
| src/service.ts | Updated to use transformTextToArray for message processing |
| src/privilege.ts | New file implementing comprehensive privilege management system |
| src/index.ts | Major refactoring of command handling and privilege checking |
| src/config/*.ts | Added time display configuration and updated templates |
| src/AI/*.ts | Refactored to use new message structure and added active timer checking |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 41 out of 42 changed files in this pull request and generated 10 comments.
Comments suppressed due to low confidence (1)
src/config/config_reply.ts:1
- There appears to be a typo in the regex pattern with three consecutive pipe characters
│|]which should likely be two characters│|]. This is inconsistent with other parts of the pattern and may cause incorrect matching.
import { ConfigManager } from "./config";
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/tool/tool_qq_list.ts
Outdated
|
|
||
| const s = `群聊数量: ${data.length}\n` + data.slice(0, 50).map((item: any, index: number) => { | ||
| return `${index + 1}. ${item.group_name}(${item.group_id}) 人数: ${item.member_count}/${item.max_member_count}`; | ||
| return { content: `${index + 1}. ${item.group_name}(${item.group_id}) 人数: ${item.member_count}/${item.max_member_count}`, images: [] }; |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue as above - returning an object inside a .map() that's being joined. Should return a string directly.
src/tool/tool_qq_list.ts
Outdated
| } | ||
| const s = `管理员数量: ${admins.length}\n` + admins.slice(0, 50).map((item: any, index: number) => { | ||
| return `${index + 1}. ${item.nickname}(${item.user_id}) ${item.card && item.card !== item.nickname ? `群名片: ${item.card}` : ''}`; | ||
| return { content: `${index + 1}. ${item.nickname}(${item.user_id}) ${item.card && item.card !== item.nickname ? `群名片: ${item.card}` : ''}`, images: [] }; |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning an object inside .map() that's being joined. Should return a string.
src/tool/tool_qq_list.ts
Outdated
| } | ||
| const s = `机器人数量: ${robots.length}\n` + robots.slice(0, 50).map((item: any, index: number) => { | ||
| return `${index + 1}. ${item.nickname}(${item.user_id}) ${item.card && item.card !== item.nickname ? `群名片: ${item.card}` : ''}`; | ||
| return { content: `${index + 1}. ${item.nickname}(${item.user_id}) ${item.card && item.card !== item.nickname ? `群名片: ${item.card}` : ''}`, images: [] }; |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning an object inside .map() that's being joined. Should return a string.
src/tool/tool_qq_list.ts
Outdated
|
|
||
| const s = `群成员数量: ${data.length}\n` + data.slice(0, 50).map((item: any, index: number) => { | ||
| return `${index + 1}. ${item.nickname}(${item.user_id}) ${item.card && item.card !== item.nickname ? `群名片: ${item.card}` : ''} ${item.title ? `头衔: ${item.title}` : ''} ${item.role === 'owner' ? '【群主】' : item.role === 'admin' ? '【管理员】' : item.is_robot ? '【机器人】' : ''}`; | ||
| return { content: `${index + 1}. ${item.nickname}(${item.user_id}) ${item.card && item.card !== item.nickname ? `群名片: ${item.card}` : ''} ${item.title ? `头衔: ${item.title}` : ''} ${item.role === 'owner' ? '【群主】' : item.role === 'admin' ? '【管理员】' : item.is_robot ? '【机器人】' : ''}`, images: [] }; |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning an object inside .map() that's being joined. Should return a string.
src/tool/tool_qq_list.ts
Outdated
|
|
||
| const s = `搜索结果好友数量: ${arr.length}\n` + arr.slice(0, 50).map((item: any, index: number) => { | ||
| return `${index + 1}. ${item.nickname}(${item.user_id}) ${item.remark && item.remark !== item.nickname ? `备注: ${item.remark}` : ''}`; | ||
| return { content: `${index + 1}. ${item.nickname}(${item.user_id}) ${item.remark && item.remark !== item.nickname ? `备注: ${item.remark}` : ''}`, images: [] }; |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning an object inside .map() that's being joined. Should return a string.
src/tool/tool_qq_list.ts
Outdated
|
|
||
| const s = `搜索结果群聊数量: ${arr.length}\n` + arr.slice(0, 50).map((item: any, index: number) => { | ||
| return `${index + 1}. ${item.group_name}(${item.group_id}) 人数: ${item.member_count}/${item.max_member_count}`; | ||
| return { content: `${index + 1}. ${item.group_name}(${item.group_id}) 人数: ${item.member_count}/${item.max_member_count}`, images: [] }; |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning an object inside .map() that's being joined. Should return a string.
src/tool/tool_qq_list.ts
Outdated
|
|
||
| const s = `搜索结果好友数量: ${arr1.length}\n` + arr1.slice(0, 50).map((item: any, index: number) => { | ||
| return `${index + 1}. ${item.nickname}(${item.user_id}) ${item.remark && item.remark !== item.nickname ? `备注: ${item.remark}` : ''}`; | ||
| return { content: `${index + 1}. ${item.nickname}(${item.user_id}) ${item.remark && item.remark !== item.nickname ? `备注: ${item.remark}` : ''}`, images: [] }; |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning an object inside .map() that's being joined. Should return a string.
src/tool/tool_qq_list.ts
Outdated
| return { content: `${index + 1}. ${item.nickname}(${item.user_id}) ${item.remark && item.remark !== item.nickname ? `备注: ${item.remark}` : ''}`, images: [] }; | ||
| }).join('\n') + `\n搜索结果群聊数量: ${arr2.length}\n` + arr2.slice(0, 50).map((item: any, index: number) => { | ||
| return `${index + 1}. ${item.group_name}(${item.group_id}) 人数: ${item.member_count}/${item.max_member_count}`; | ||
| return { content: `${index + 1}. ${item.group_name}(${item.group_id}) 人数: ${item.member_count}/${item.max_member_count}`, images: [] }; |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning an object inside .map() that's being joined. Should return a string.
src/tool/tool_qq_list.ts
Outdated
|
|
||
| const s = `共群数量: ${arr.length}\n` + arr.slice(0, 50).map((item: any, index: number) => { | ||
| return `${index + 1}. ${item.group_info.group_name}(${item.group_info.group_id}) 人数: ${item.group_info.member_count}/${item.group_info.max_member_count} ${item.user_info.card && item.user_info.card !== item.user_info.nickname ? `群名片: ${item.user_info.card}` : ''}`; | ||
| return { content: `${index + 1}. ${item.group_info.group_name}(${item.group_info.group_id}) 人数: ${item.group_info.member_count}/${item.group_info.max_member_count} ${item.user_info.card && item.user_info.card !== item.user_info.nickname ? `群名片: ${item.user_info.card}` : ''}`, images: [] }; |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning an object inside .map() that's being joined. Should return a string.
| return { content: `${index + 1}. ${item.group_info.group_name}(${item.group_info.group_id}) 人数: ${item.group_info.member_count}/${item.group_info.max_member_count} ${item.user_info.card && item.user_info.card !== item.user_info.nickname ? `群名片: ${item.user_info.card}` : ''}`, images: [] }; | |
| return `${index + 1}. ${item.group_info.group_name}(${item.group_info.group_id}) 人数: ${item.group_info.member_count}/${item.group_info.max_member_count} ${item.user_info.card && item.user_info.card !== item.user_info.nickname ? `群名片: ${item.user_info.card}` : ''}`; |
src/tool/tool_ban.ts
Outdated
|
|
||
| const s = `被禁言成员数量: ${data.length}\n` + data.slice(0, 50).map((item: any, index: number) => { | ||
| return `${index + 1}. ${item.nick}(${item.uin}) ${item.cardName && item.cardName !== item.nick ? `群名片: ${item.cardName}` : ''} 禁言结束时间: ${new Date(item.shutUpTime * 1000).toLocaleString()}`; | ||
| return { content: `${index + 1}. ${item.nick}(${item.uin}) ${item.cardName && item.cardName !== item.nick ? `群名片: ${item.cardName}` : ''} 禁言结束时间: ${fmtDate(item.shutUpTime)}`, images: [] }; |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning an object inside .map() that's being joined. Should return a string.
| return { content: `${index + 1}. ${item.nick}(${item.uin}) ${item.cardName && item.cardName !== item.nick ? `群名片: ${item.cardName}` : ''} 禁言结束时间: ${fmtDate(item.shutUpTime)}`, images: [] }; | |
| return `${index + 1}. ${item.nick}(${item.uin})${item.cardName && item.cardName !== item.nick ? ` 群名片: ${item.cardName}` : ''} 禁言结束时间: ${fmtDate(item.shutUpTime)}`; |
* feat: 添加markdown/html图片渲染工具和相关后端项目 * style调整 * feat:将md和html拆分成两个函数 * style * feat:修改为base64返回,允许长久储存 * style * 对image进行重构 --------- Co-authored-by: error2913 <2913949387@qq.com>
* feat:允许render工具渲染url和base64图片 * fix:添加对html中图片作为背景的替换兼容 * 改回第一版( * update update info --------- Co-authored-by: error2913 <2913949387@qq.com>
No description provided.