-
-
Notifications
You must be signed in to change notification settings - Fork 5
添加非标准API的OPT警告,重构转发消息API以使用OneBotForwardNode #251
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
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 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 |
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.
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.
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.
Qodana Community for JVMIt 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 Contact Qodana teamContact us at [email protected]
|
详见 #250