Skip to content

Conversation

ForliyScarlet
Copy link
Member

@ForliyScarlet ForliyScarlet commented Aug 22, 2025

No description provided.

ForteScarlet and others added 25 commits August 18, 2025 13:36
支持 ChannelKickoutApi (/channel/kickout)
…bot/kook/api/channel/GetChannelUserListApi.kt

Co-authored-by: Copilot <[email protected]>
…st-API

支持获取语音频道用户列表api
…bot/kook/api/channel/ChannelKickoutApiTest.kt

Co-authored-by: Copilot <[email protected]>
…bot/kook/api/channel/ChannelKickoutApiTest.kt

Co-authored-by: Copilot <[email protected]>
…bot/kook/api/channel/ChannelKickoutApiTest.kt

Co-authored-by: Copilot <[email protected]>
…-API

改进 ChannelKickoutApi 的部分相关测试
…bot/kook/api/channel/ChannelMoveUserApi.kt

Co-authored-by: Copilot <[email protected]>
…er-API

支持频道之间移动用户api
- Added support for managing voice channel members (e.g., move and kickout functionalities).
- Implemented the KookVoiceMember interface and its core logic.
- Integrated voice channel handling in the guild structure.
- Updated related APIs for consistency.
增加 KookVoiceChannel 和 KookVoiceMember 等语音频道相关API支持
@ForteScarlet ForteScarlet requested review from ForteScarlet and Copilot and removed request for ForteScarlet August 22, 2025 09:15
ForteScarlet
ForteScarlet previously approved these changes Aug 22, 2025
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 pull request introduces comprehensive voice channel support to the KOOK component, adding new classes and interfaces to manage voice channels and their members.

  • Implementation of KookVoiceChannel interface with voice channel management capabilities
  • Addition of KookVoiceMember interface for voice-specific member operations
  • Creation of new API classes for voice channel operations including join, leave, move user, and kickout

Reviewed Changes

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

Show a summary per file
File Description
KookVoiceChannel.kt New interface defining voice channel functionality with member management
KookVoiceMember.kt New interface for voice channel members with move and kickout operations
KookVoiceChannelImpl.kt Implementation of voice channel with user management and member operations
KookVoiceMemberImpl.kt Implementation of voice member with delegation pattern
KookChatCapableChannel.kt New abstract base for channels that support messaging
Utils.kt Utility functions for channel type conversion and category management
Various API classes New voice-related API implementations for backend operations
Tests Comprehensive test coverage for new voice APIs
Comments suppressed due to low confidence (1)

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

val delegateMember = bot.internalMember(guildId = source.guildId, userId = it.id)
logger.trace("Processing voice channel user-list(id={})'s delegate member: {}", it.id, delegateMember)
if (delegateMember == null) {
logger.warn("Delegate member for voice channel's user(id={}) is null.", it)
Copy link
Preview

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

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

The log message uses it which refers to the VoiceChannelUser object, but the message suggests it should show the user ID. Consider changing to it.id for clearer logging.

Suggested change
logger.warn("Delegate member for voice channel's user(id={}) is null.", it)
logger.warn("Delegate member for voice channel's user(id={}) is null.", it.id)

Copilot uses AI. Check for mistakes.

@@ -98,7 +100,7 @@ internal class KookBotImpl(

return try {
id.literal == botUserInfo.id
} catch (e: IllegalStateException) {
} catch (_: IllegalStateException) {
// ignore match and return true
Copy link
Preview

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

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

Using underscore for unused exception parameter is good practice, but the comment should be updated. The catch block comment says 'ignore match and return true' but this seems backwards - it should probably be 'ignore exception and return false' or explain why true is returned on exception.

Suggested change
// ignore match and return true
// ignore exception and return true

Copilot uses AI. Check for mistakes.

"ApiResult(" +
"code=$code, " +
"message=$message, " +
"data=$data, " +
Copy link
Preview

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

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

[nitpick] The toString() method improvement adds null checks for uninitialized properties, but the data field is not checked like the others (httpStatus, rateLimit, raw). Consider adding a similar null check for data if it can also be uninitialized.

Suggested change
"data=$data, " +
"data=${dataOrNull ?: "<Not Initialized>"}, " +

Copilot uses AI. Check for mistakes.

@ForliyScarlet
Copy link
Member Author

ForliyScarlet commented Aug 22, 2025

Qodana Community for JVM

It seems all right 👌

No new problems were found according to the checks applied

💡 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]

@ForteScarlet ForteScarlet merged commit 858c27e into main Aug 22, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants