-
Notifications
You must be signed in to change notification settings - Fork 74
✨ 添加新方法 #105
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
✨ 添加新方法 #105
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 introduces a series of new API wrapper methods on the Ctx
type to support group sign-in, poking, ark sharing, translation, AI services, and other chat operations.
- Added over 25 new
Ctx
methods for various API actions (group sign, poke, share cards, message history, collections, AI, etc.) - Each method calls
ctx.CallAction
with appropriate parameters and, where applicable, returnsgjson.Result
Comments suppressed due to low confidence (7)
api.go:763
- This method ignores potential errors from
CallAction
; consider returning anerror
and propagating it to the caller so failures can be handled.
func (ctx *Ctx) SetGroupSign(groupID int64) {
api.go:763
- New API wrapper methods added here lack corresponding unit tests; consider adding tests to verify parameter serialization and expected responses.
func (ctx *Ctx) SetGroupSign(groupID int64) {
api.go:791
- [nitpick] Method and action name
ArkSharePeer
use PascalCase, while other actions use snake_case; consider renaming the action key toark_share_peer
for consistency.
func (ctx *Ctx) ArkSharePeer(userID, groupID string) gjson.Result {
api.go:801
- [nitpick] Method and action name
ArkShareGroup
use PascalCase, while other actions use snake_case; consider renaming the action key toark_share_group
for consistency.
func (ctx *Ctx) ArkShareGroup(groupID string) gjson.Result {
api.go:879
- [nitpick] JSON key
reverseOrder
uses camelCase but other parameters follow snake_case; consider changing it toreverse_order
for consistency.
"reverseOrder": reverseOrder,
api.go:902
- [nitpick] JSON key
longNick
should use snake_caselong_nick
to align with the rest of the API parameter naming.
"longNick": longNick,
api.go:919
- Action name has a leading underscore. Consider using
mark_all_as_read
(without the leading underscore) to match the pattern for other endpoints.
ctx.CallAction("_mark_all_as_read", Params{})
牛逼 |
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.
建议简单的数据结构直接解析后返回避免杂乱。我看了前几个就发现不少可以直接解析的。
No description provided.