-
-
Notifications
You must be signed in to change notification settings - Fork 4
Release: v1.8.0 #210
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
Release: v1.8.0 #210
Conversation
Co-authored-by: Copilot <[email protected]>
OneBotApi支持指定method与自定义的URL操作; 调整部分依赖配置
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 release (v1.8.0) introduces support for customizable event resolution via a new CustomEventResolver
API, refactors the event parsing pipeline in OneBotBotImpl
, and adds URL/method helpers to the OneBot API interface.
- Add new exception types (
EventResolveException
,CustomEventResolveException
) and interfaces (CustomEventResolver
,CustomKotlinSerializationEventResolver
) - Refactor
OneBotBotImpl
to extractresolveEvent
/resolveRawEvent
returningRawEventResolveResult
and wire in custom resolvers - Extend
OneBotApi
withmethod
,resolveUrlAction
,resolveUrlExtensions
, and update request implementations
Reviewed Changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
EventResolveException.kt | New exception for event resolution errors |
CustomKotlinSerializationEventResolver.kt | Fun‐interface for Kotlin Serialization–based resolvers |
CustomEventResolver.kt / CustomEventResolveException.kt | Core resolver API and exception |
OneBotBotImpl.kt | Extracted resolveEvent , integrated custom resolvers, updated pipeline |
OneBotBotConfiguration.kt | Configuration hooks for registering custom resolvers |
OneBotApi.kt / OneBotApiRequests.kt | Added HTTP method & URL resolution extension points |
build.gradle.kts & wrapper | Bumped Gradle, dependency visibility tweaks |
buildSrc / workflows | Task registration, version bumps, workflow args updates |
Comments suppressed due to low confidence (3)
simbot-component-onebot-v11/simbot-component-onebot-v11-core/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/core/bot/internal/OneBotBotImpl.kt:795
- Only
SerializationException
is caught here butdecodeFromJsonElement
can also throwIllegalArgumentException
; consider adding a catch forIllegalArgumentException
to wrap it into the result rather than letting it propagate.
catch (serEx: SerializationException) {
buildSrc/src/main/kotlin/JvmConfig.kt:32
- [nitpick] Removing
withJava()
may disable automatic Java source-set support for mixed Kotlin/Java projects; verify that this change won't break Java interop or compilation of Java code.
withJava()
simbot-component-onebot-v11/simbot-component-onebot-v11-core/build.gradle.kts:108
- Changing the Ktor Java client from
api
toimplementation
hides it from downstream consumers; ensure no public API requires exposing this dependency.
implementation(libs.ktor.client.java)
return serializer(context)?.let { | ||
return context.json.decodeFromJsonElement(it, context.rawEventResolveResult.json) |
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 nested return
inside the let
lambda prevents the outer expression from compiling as intended and is redundant; instead, use serializer(context)?.let { context.json.decodeFromJsonElement(it, context.rawEventResolveResult.json) }
followed by a single return
or an explicit return null
if no serializer is found.
return serializer(context)?.let { | |
return context.json.decodeFromJsonElement(it, context.rawEventResolveResult.json) | |
return serializer(context)?.let { | |
context.json.decodeFromJsonElement(it, context.rawEventResolveResult.json) |
Copilot uses AI. Check for mistakes.
// 接收的事件解析出现错误, | ||
// 这应该是预期外的情况, | ||
// 直接终止 session, 但是不终止 Bot, | ||
// 只有当重连次数用尽才考虑终止 Bot。 | ||
// TODO 终止session吗? |
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] The TODO comment is in Chinese; consider using a consistent language (English) for code comments so that all contributors can understand and address it.
// 接收的事件解析出现错误, | |
// 这应该是预期外的情况, | |
// 直接终止 session, 但是不终止 Bot, | |
// 只有当重连次数用尽才考虑终止 Bot。 | |
// TODO 终止session吗? | |
// An error occurred while parsing the received event, | |
// which should be an unexpected situation. | |
// Directly terminate the session, but do not terminate the bot. | |
// Only consider terminating the bot when the reconnection attempts are exhausted. | |
// TODO Should the session be terminated? |
Copilot uses AI. Check for mistakes.
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.
就不,中文怎么你了
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]
|
No description provided.