Skip to content

Conversation

ForteScarlet
Copy link
Member

/channel/move-user
close #264

@ForteScarlet ForteScarlet self-assigned this Aug 19, 2025
@ForteScarlet ForteScarlet added 特性 新的功能或特性 API 与API相关 labels Aug 19, 2025
@ForteScarlet ForteScarlet requested a review from Copilot August 19, 2025 16:49
@ForteScarlet ForteScarlet enabled auto-merge August 19, 2025 16:49
Copy link
Contributor

@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 adds support for the "move user between channels" API endpoint (/channel/move-user) for the KOOK platform. The implementation allows moving users between voice channels programmatically.

  • Implements ChannelMoveUserApi class with both List and varargs factory methods
  • Adds comprehensive test coverage for the new API functionality
  • Updates the public API surface to expose the new functionality

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
ChannelMoveUserApi.kt Main implementation of the channel move user API with serializable body and factory methods
ChannelMoveUserApiTest.kt Comprehensive test suite covering API structure, serialization, and mock HTTP responses
simbot-component-kook-api.api Public API surface updates to expose the new ChannelMoveUserApi class and methods

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


assertTrue(result.isSuccess)
assertEquals(0, result.code)
assertEquals("操作成功", result.message)
Copy link
Preview

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

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

[nitpick] Hardcoded Chinese success message makes the test brittle if the API response format changes. Consider using a constant or making the test more flexible about the exact message content.

Suggested change
assertEquals("操作成功", result.message)
assertTrue(result.message.contains("成功"), "Expected success message to contain '成功', but was '${result.message}'")

Copilot uses AI. Check for mistakes.

// Wrap in KOOK API result format
val apiResultJson = """{
"code": 0,
"message": "操作成功",
Copy link
Preview

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

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

[nitpick] Hardcoded Chinese success message is repeated in multiple tests. Consider extracting this to a constant to improve maintainability.

Suggested change
"message": "操作成功",
"message": "$SUCCESS_MESSAGE",

Copilot uses AI. Check for mistakes.

@ForliyScarlet
Copy link
Member

ForliyScarlet commented Aug 19, 2025

Qodana Community for JVM

2 new problems were found

Inspection name Severity Problems
Redundant interpolation prefix ◽️ Notice 2

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

…bot/kook/api/channel/ChannelMoveUserApi.kt

Co-authored-by: Copilot <[email protected]>
@ForteScarlet ForteScarlet merged commit 5d36e13 into dev/main Aug 20, 2025
6 of 10 checks passed
@ForteScarlet ForteScarlet deleted the dev/support-channel-move-user-API branch August 20, 2025 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API 与API相关 特性 新的功能或特性
Projects
None yet
Development

Successfully merging this pull request may close these issues.

缺少频道之间移动用户api
2 participants