Repository navigation
添加非标准API的OPT警告,重构转发消息API以使用OneBotForwardNode - #251
Conversation
There was a problem hiding this comment.
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.
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 |
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 qodana-support@jetbrains.com
|
详见 #250