-
-
Notifications
You must be signed in to change notification settings - Fork 1
支持频道之间移动用户api #288
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
支持频道之间移动用户api #288
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 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.
...nent-kook-api/src/commonMain/kotlin/love/forte/simbot/kook/api/channel/ChannelMoveUserApi.kt
Outdated
Show resolved
Hide resolved
|
||
assertTrue(result.isSuccess) | ||
assertEquals(0, result.code) | ||
assertEquals("操作成功", result.message) |
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.
[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.
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": "操作成功", |
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.
[nitpick] Hardcoded Chinese success message is repeated in multiple tests. Consider extracting this to a constant to improve maintainability.
"message": "操作成功", | |
"message": "$SUCCESS_MESSAGE", |
Copilot uses AI. Check for mistakes.
Qodana Community for JVM2 new problems were found
💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at [email protected]
|
…bot/kook/api/channel/ChannelMoveUserApi.kt Co-authored-by: Copilot <[email protected]>
/channel/move-user
close #264