Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

ForliyScarlet
Copy link
Member

@ForliyScarlet ForliyScarlet commented Sep 14, 2025

详见 #250

@ForteScarlet ForteScarlet changed the title 添加非标准API的OPT经过,重构转发消息API以使用OneBotForwardNode 添加非标准API的OPT警告,重构转发消息API以使用OneBotForwardNode Sep 14, 2025
@ForteScarlet ForteScarlet self-assigned this Sep 14, 2025
@ForteScarlet ForteScarlet added the 缺陷 一个缺陷 label Sep 14, 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 PR refactors forward message APIs to use OneBotForwardNode and adds OPT warnings for non-standard APIs. The changes improve API consistency and warn developers about non-standard API usage.

  • Extracts OneBotForwardNode from OneBotForward.kt into its own file
  • Refactors forward message APIs to use List instead of OneBotMessageOutgoing
  • Adds OneBotNonStandardApi annotation to warn about non-standard API usage

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
OneBotForwardNode.kt New file containing extracted OneBotForwardNode class with enhanced functionality
OneBotForward.kt Removed OneBotForwardNode class and updated license header
MessageElementResolvers.kt Added DefaultImageAdditionalParams type alias and updated copyright
MessageResolvers.kt Made bot parameter nullable in message resolution
SendPrivateForwardMsgApi.kt Refactored to use OneBotForwardNode list and added non-standard API annotation
SendGroupForwardMsgApi.kt Refactored to use OneBotForwardNode list, added annotations, and updated result type
OneBotNonStandardApi.kt New annotation for marking non-standard APIs
OneBotMessageOutgoing.kt Added utility methods for creating instances from Messages
simbot-component-onebot-v11-core.api Updated API signatures to reflect changes
ComponentOpts.kt Added TYPEALIAS target to annotation

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

public val messageId: IntID,
@SerialName("forward_id")
public val forwardId: StringID
public val forwardId: ID
Copy link
Preview

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

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

The change from StringID to ID for forwardId could be a breaking change for consumers expecting a specific ID type. Consider documenting this change or maintaining backward compatibility.

Suggested change
public val forwardId: ID
public val forwardId: ID,
/**
* Backward compatibility: forwardId as String.
* @deprecated Use [forwardId] of type [ID] instead.
*/
@Deprecated(
message = "Use forwardId of type ID instead.",
replaceWith = ReplaceWith("forwardId"),
level = DeprecationLevel.WARNING
)
val forwardIdString: String = forwardId.value

Copilot uses AI. Check for mistakes.

@ForliyScarlet
Copy link
Member Author

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 215d726 into dev/main Sep 14, 2025
4 checks passed
@ForteScarlet ForteScarlet deleted the dev/improve-sendforwardmsg-APIs branch September 14, 2025 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
缺陷 一个缺陷
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants