Skip to content

Conversation

guohuiyuan
Copy link
Contributor

No description provided.

@wdvxdr1123 wdvxdr1123 requested a review from Copilot July 4, 2025 16:01
Copy link

@Copilot Copilot AI left a 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, returns gjson.Result
Comments suppressed due to low confidence (7)

api.go:763

  • This method ignores potential errors from CallAction; consider returning an error 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 to ark_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 to ark_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 to reverse_order for consistency.
		"reverseOrder": reverseOrder,

api.go:902

  • [nitpick] JSON key longNick should use snake_case long_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{})

@guohuiyuan
Copy link
Contributor Author

牛逼

Copy link
Collaborator

@fumiama fumiama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议简单的数据结构直接解析后返回避免杂乱。我看了前几个就发现不少可以直接解析的。

@fumiama fumiama merged commit 6197b8e into wdvxdr1123:main Jul 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants