feat(chat): 添加 chat compact 指令#1210
Merged
Merged
Conversation
- 注册 chat compact 子命令,仅限 superuser 使用 - 可选传入会话 ID,不传则使用当前会话 - 生成即时记忆后重置消息队列,保留记忆上下文 - 在 zh_hans/zh_tw/en_us 本地化文件中添加相关提示文本 - 在 help.yaml 中添加帮助信息
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
xxtg666
approved these changes
Jun 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动内容
新增
chat compact指令注册
chat compact [会话ID]子命令,用于压缩会话的消息队列。功能说明:
典型使用场景:
修改的文件
src/plugins/nonebot_plugin_chat/matcher/chat.py— 添加handle_compact方法和 match casesrc/lang/zh_hans/chat.yaml— 添加 compact 相关本地化字符串和帮助条目src/lang/zh_tw/chat.yaml— 同上src/lang/en_us/chat.yaml— 同上src/plugins/nonebot_plugin_chat/help.yaml— 更新 usage 数量