-
Notifications
You must be signed in to change notification settings - Fork 927
feat:add onebotv11 face send and accept but some face no name. #1543
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: master
Are you sure you want to change the base?
Conversation
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 PR adds support for handling face messages in the onbotv11 adapter, grouping certain emoji types—including dice and rock-paper-scissors—under the new Face message class. Key changes include:
- Updating the File message component to initialize size as an integer.
- Adding a new Face message class with dedicated str and rps_data methods.
- Enhancing message conversion in aiocqhttp to process face, rps, and dice messages.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
pkg/platform/types/message.py | Updated File component and introduced new Face message class. |
pkg/platform/sources/aiocqhttp.py | Implemented conversion logic for face, rps, and dice messages. |
2 : "剪刀", | ||
3 : "石头", | ||
} | ||
return rps_dict[face_id] |
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.
Consider using dictionary get() with a default value or handling the missing key explicitly to avoid a potential KeyError if an unexpected face_id is passed.
return rps_dict[face_id] | |
return rps_dict.get(face_id, "未知") |
Copilot uses AI. Check for mistakes.
face_id = msg.data['id'] | ||
face_name = msg.data['raw']['faceText'] | ||
if not face_name: | ||
face_name = get_face_name(face_id) |
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.
Face IDs in the face_code_dict are specified as strings; consider converting face_id to a string (or updating the dictionary keys) to ensure a successful lookup.
face_name = get_face_name(face_id) | |
face_name = get_face_name(str(face_id)) |
Copilot uses AI. Check for mistakes.
概述 / Overview
增加了onbotv11适配器的接受和发送表情的功能,新增了face消息类,将超级表情骰子和划拳一同归为face,但是有部分古老表情在消息中拿不到face_name,如需要需要需插件或者后续将表情表适配?
检查清单 / Checklist
PR 作者完成 / For PR author
请在方括号间写
x
以打勾 / Please tick the box withx
项目维护者完成 / For project maintainer