-
Notifications
You must be signed in to change notification settings - Fork 225
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
feat: 群名称变更事件 #664
feat: 群名称变更事件 #664
Conversation
审核指南由 Sourcery 提供此拉取请求实现了一个新的自定义事件, 群组名称更改事件处理的时序图sequenceDiagram
participant User as Group Admin
participant Bot
participant OneBotGroupApi
participant OB11GroupNameEvent
User->>Bot: 更改群组名称
Bot->>OneBotGroupApi: 接收原始消息
OneBotGroupApi->>OneBotGroupApi: parseGrayTipElement()
OneBotGroupApi->>OneBotGroupApi: parseGroupElement()
Note over OneBotGroupApi: 检查类型是否为 KGROUPNAMEMODIFIED
OneBotGroupApi->>OB11GroupNameEvent: 创建新事件
Note over OB11GroupNameEvent: 存储新群组名称
群组名称事件实现的类图classDiagram
class OB11GroupNoticeEvent {
+notice_type: string
}
class OB11GroupNameEvent {
+notice_type: string
+name_new: string
+constructor(core: NapCatCore, groupId: number, userId: number, nameNew: string)
}
class OneBotGroupApi {
+parseGroupElement(msg: RawMessage, element: TipGroupElement, elementWrapper: GrayTipElement)
+parseGrayTipElement(msg: RawMessage, grayTipElement: GrayTipElement)
}
OB11GroupNoticeEvent <|-- OB11GroupNameEvent
note for OB11GroupNameEvent "用于处理群组名称更改的新类"
文件级更改
提示和命令与 Sourcery 互动
自定义您的体验访问您的仪表板以:
获取帮助Original review guide in EnglishReviewer's Guide by SourceryThis pull request implements a new custom event, Sequence diagram for group name change event handlingsequenceDiagram
participant User as Group Admin
participant Bot
participant OneBotGroupApi
participant OB11GroupNameEvent
User->>Bot: Changes group name
Bot->>OneBotGroupApi: Receives raw message
OneBotGroupApi->>OneBotGroupApi: parseGrayTipElement()
OneBotGroupApi->>OneBotGroupApi: parseGroupElement()
Note over OneBotGroupApi: Checks if type is KGROUPNAMEMODIFIED
OneBotGroupApi->>OB11GroupNameEvent: Creates new event
Note over OB11GroupNameEvent: Stores new group name
Class diagram for group name event implementationclassDiagram
class OB11GroupNoticeEvent {
+notice_type: string
}
class OB11GroupNameEvent {
+notice_type: string
+name_new: string
+constructor(core: NapCatCore, groupId: number, userId: number, nameNew: string)
}
class OneBotGroupApi {
+parseGroupElement(msg: RawMessage, element: TipGroupElement, elementWrapper: GrayTipElement)
+parseGrayTipElement(msg: RawMessage, grayTipElement: GrayTipElement)
}
OB11GroupNoticeEvent <|-- OB11GroupNameEvent
note for OB11GroupNameEvent "New class for handling group name changes"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Quality Gate passedIssues Measures |
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.
嗨 @clansty - 我已经审查了你的更改 - 这里有一些反馈:
总体评论:
- 考虑添加文档来描述这个自定义事件类型,包括其结构和触发条件,因为它不是标准协议的一部分。
这是我在审查期间查看的内容
- 🟢 一般问题:一切看起来都很好
- 🟢 安全性:一切看起来都很好
- 🟢 测试:一切看起来都很好
- 🟢 复杂性:一切看起来都很好
- 🟢 文档:一切看起来都很好
帮助我变得更有用!请在每条评论上点击 👍 或 👎,我将使用反馈来改进你的评论。
Original comment in English
Hey @clansty - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding documentation to describe this custom event type, including its structure and trigger conditions, since it's not part of the standard protocol.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
自定义事件 notice.notify.group_name
gocq 和 onebot11 规范里面并没有找到这样的事件,所以作为 napcat 自定义事件添加
Summary by Sourcery
新功能:
notice.notify.group_name
事件,当群组名称更改时触发。Original summary in English
Summary by Sourcery
New Features:
notice.notify.group_name
event, which is triggered when a group name is changed.