Git Product home page Git Product logo

simple-robot / simbot-component-kook Goto Github PK

View Code? Open in Web Editor NEW
18.0 2.0 1.0 10.2 MB

一个 Kotlin 多平台的 KOOK(开黑啦) Bot SDK 实现库,一个 Simple Robot 组件库,Java 友好、异步高效~ ❤️‍🔥❤️‍🔥😘

Home Page: https://simbot.forte.love/component-kook.html

License: GNU Lesser General Public License v3.0

Kotlin 96.87% CSS 0.90% JavaScript 1.69% Java 0.41% HTML 0.12%
kook simbot simple-robot kotlin kook-bot kook-api kookapp kookapp-bot kook-sdk kotlin-coroutines

simbot-component-kook's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

koprojects

simbot-component-kook's Issues

3.0.0.0.preview.3.0 无法正常启动

版本:

     	<dependency>
            <groupId>love.forte.simbot.boot</groupId>
            <artifactId>simboot-core</artifactId>
            <version>3.0.0.preview.8.0</version>
        </dependency>
        <dependency>
            <groupId>love.forte.simbot.component</groupId>
            <artifactId>simbot-component-kaiheila-boot</artifactId>
            <version>3.0.0.0.preview.3.0</version>
        </dependency>

问题描述: 无法正常启动开黑啦组件

启动问题:


Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-04-28 09:49:42.921 ERROR 11044 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'runAndConfigSimbotContext' defined in love.forte.simboot.autoconfigure.SimbootAutoconfigure: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [love.forte.simboot.SimbootContext]: Factory method 'runAndConfigSimbotContext' threw exception; nested exception is love.forte.simboot.SimbootApplicationException: java.lang.AbstractMethodError: Receiver class love.forte.simboot.autoconfigure.SpringResourceBotVerifyInfo does not define or inherit an implementation of the resolved method 'abstract java.lang.String getComponentId()' of interface love.forte.simbot.BotVerifyInfo.
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.18.jar:5.3.18]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638) ~[spring-beans-5.3.18.jar:5.3.18]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.18.jar:5.3.18]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.18.jar:5.3.18]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.18.jar:5.3.18]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.18.jar:5.3.18]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.18.jar:5.3.18]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.18.jar:5.3.18]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.18.jar:5.3.18]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.18.jar:5.3.18]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:953) ~[spring-beans-5.3.18.jar:5.3.18]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.18.jar:5.3.18]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.18.jar:5.3.18]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.6.jar:2.6.6]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) ~[spring-boot-2.6.6.jar:2.6.6]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) ~[spring-boot-2.6.6.jar:2.6.6]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) ~[spring-boot-2.6.6.jar:2.6.6]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) ~[spring-boot-2.6.6.jar:2.6.6]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) ~[spring-boot-2.6.6.jar:2.6.6]
	at com.catcraft.tyche.khl.KhlBotRunApplication.main(KhlBotRunApplication.java:11) ~[classes/:na]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [love.forte.simboot.SimbootContext]: Factory method 'runAndConfigSimbotContext' threw exception; nested exception is love.forte.simboot.SimbootApplicationException: java.lang.AbstractMethodError: Receiver class love.forte.simboot.autoconfigure.SpringResourceBotVerifyInfo does not define or inherit an implementation of the resolved method 'abstract java.lang.String getComponentId()' of interface love.forte.simbot.BotVerifyInfo.
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.18.jar:5.3.18]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.18.jar:5.3.18]
	... 19 common frames omitted
Caused by: love.forte.simboot.SimbootApplicationException: java.lang.AbstractMethodError: Receiver class love.forte.simboot.autoconfigure.SpringResourceBotVerifyInfo does not define or inherit an implementation of the resolved method 'abstract java.lang.String getComponentId()' of interface love.forte.simbot.BotVerifyInfo.
	at love.forte.simboot.SimbootApp.run(SimbootApp.kt:75) ~[simboot-api-3.0.0.preview.8.0.jar:na]
	at love.forte.simboot.autoconfigure.DefaultSimbootAppRunner.run(SimbootAppRunnerConfiguration.kt:49) ~[simboot-core-spring-boot-starter-3.0.0.preview.7.0.jar:na]
	at love.forte.simboot.autoconfigure.SimbootAutoconfigure.runAndConfigSimbotContext(SimbootAutoconfigure.kt:45) ~[simboot-core-spring-boot-starter-3.0.0.preview.7.0.jar:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.18.jar:5.3.18]
	... 20 common frames omitted
Caused by: java.lang.AbstractMethodError: Receiver class love.forte.simboot.autoconfigure.SpringResourceBotVerifyInfo does not define or inherit an implementation of the resolved method 'abstract java.lang.String getComponentId()' of interface love.forte.simbot.BotVerifyInfo.
	at love.forte.simbot.component.kaiheila.KaiheilaBotManager.register(KaiheilaBotManager.kt:50) ~[simbot-component-kaiheila-core-3.0.0.0.preview.3.0.jar:na]
	at love.forte.simbot.component.kaiheila.KaiheilaBotManager.register(KaiheilaBotManager.kt:38) ~[simbot-component-kaiheila-core-3.0.0.0.preview.3.0.jar:na]
	at love.forte.simboot.core.CoreBootEntrance.run0(CoreBootEntrance.kt:231) ~[simboot-core-3.0.0.preview.8.0.jar:na]
	at love.forte.simboot.core.CoreBootEntrance.run(CoreBootEntrance.kt:127) ~[simboot-core-3.0.0.preview.8.0.jar:na]
	at love.forte.simboot.SimbootApp.run(SimbootApp.kt:73) ~[simboot-api-3.0.0.preview.8.0.jar:na]
	... 27 common frames omitted


进程已结束,退出代码1

重构

部分内容需要重构,例如重构API模块,使其所有的API封装都拥有标准的风格

API 模块

  • Kotlin 多平台实现

重构阶段优先实现较为常用的或原本就有实现的API

(API)事件相关:

  • 事件类型与解析
  • 事件订阅
  • 消息相关事件
    • 频道消息更新、删除
    • 私聊消息更新、删除
  • 系统事件
    • 子频道相关事件(变更、消息pin等)
    • 频道服务器相关事件(变更等)
    • 频道成员相关事件
    • 频道权限(Role)相关事件
    • 频道用户封禁相关事件
    • 用户相关事件(信息更新等)
    • Bot自身事件(加入、离开频道等)
    • 其他事件(例如Card中的button被点击事件)
    • reaction 相关事件
  • 未知消息处理

标准库模块

  • Bot 实现(包括与服务器的连接、事件的订阅)
  • Kotlin多平台实现
  • ws压缩数据接收(仅在 JVM 平台和 JS 平台上支持、且 JS 默认不开启)

核心模块

  • KookBot 与API模块关联类型定义与实现
  • 与 API 模块对应的事件实现
  • 事件与内建缓存的刷新

以及其他 ...

Session received frame failed: Channel was closed, try reconnect.

2023-10-11T21:42:02.903+08:00 ERROR 3386134 --- [atcher-worker-2] l.f.s.kook.bot.client.jqdlyHK85xe1i5Bo   : Session received frame failed: Channel was closed, try reconnect.

kotlinx.coroutines.channels.ClosedReceiveChannelException: Channel was closed
        at kotlinx.coroutines.channels.Closed.getReceiveException(AbstractChannel.kt:1108) ~[kotlinx-coroutines-core-jvm-1.6.4.jar!/:na]
        at kotlinx.coroutines.channels.AbstractChannel$ReceiveElement.resumeReceiveClosed(AbstractChannel.kt:913) ~[kotlinx-coroutines-core-jvm-1.6.4.jar!/:na]
        at kotlinx.coroutines.channels.AbstractChannel.receiveSuspend(AbstractChannel.kt:609) ~[kotlinx-coroutines-core-jvm-1.6.4.jar!/:na]
        at kotlinx.coroutines.channels.AbstractChannel.receive(AbstractChannel.kt:593) ~[kotlinx-coroutines-core-jvm-1.6.4.jar!/:na]
        at love.forte.simbot.kook.internal.KookBotImpl$Receive.invoke(KookBotImpl.kt:551) ~[simbot-component-kook-stdlib-3.0.0.0-alpha.4.jar!/:na]
        at love.forte.simbot.kook.internal.KookBotImpl$StageLoop.invoke(KookBotImpl.kt:706) ~[simbot-component-kook-stdlib-3.0.0.0-alpha.4.jar!/:na]
        at love.forte.simbot.kook.internal.KookBotImpl$StageLoop.run(KookBotImpl.kt:693) ~[simbot-component-kook-stdlib-3.0.0.0-alpha.4.jar!/:na]
        at love.forte.simbot.kook.internal.KookBotImpl$StageLoop$run$1.invokeSuspend(KookBotImpl.kt) ~[simbot-component-kook-stdlib-3.0.0.0-alpha.4.jar!/:na]
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[kotlin-stdlib-1.8.10.jar!/:1.8.10-release-430(1.8.10)]
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104) ~[kotlinx-coroutines-core-jvm-1.6.4.jar!/:na]
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) ~[kotlinx-coroutines-core-jvm-1.6.4.jar!/:na]
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) ~[kotlinx-coroutines-core-jvm-1.6.4.jar!/:na]
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) ~[kotlinx-coroutines-core-jvm-1.6.4.jar!/:na]
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) ~[kotlinx-coroutines-core-jvm-1.6.4.jar!/:na]

3.0.0.0.preview.15.0-SNAPSHOT无法发送信息

使用直接发送字符串的方法时:

[DefaultDispatcher-worker-4] ERROR love.forte.simbot.core.event.SimpleEventListenerManagerImpl - Listener [SimpleListener(targets=[EventKey(id=api.channel_message)])@2109591614] process failed: java.lang.NullPointerException
love.forte.simbot.event.EventListenerProcessingException: java.lang.NullPointerException
        at love.forte.simbot.core.event.ListenerInvoker.invoke(SimpleEventListenerManagerImpl.kt:456)
        at love.forte.simbot.core.event.ListenerInvoker$invoke$1.invokeSuspend(SimpleEventListenerManagerImpl.kt)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Caused by: java.lang.NullPointerException
        at love.forte.simbot.component.kook.internal.KookGuildImpl.getBot(KookGuildImpl.kt:87)
        at love.forte.simbot.component.kook.internal.KookChannelImpl.getBot(KookChannelImpl.kt:57)
        at love.forte.simbot.component.kook.KookChannel.send$suspendImpl(KookChannel.kt:138)
        at love.forte.simbot.component.kook.KookChannel.send(KookChannel.kt)
        at love.forte.simbot.component.kook.KookChannel.send$suspendImpl(KookChannel.kt:153)
        at love.forte.simbot.component.kook.KookChannel.send(KookChannel.kt)
        at love.forte.simbot.component.kook.KookChannel.send$suspendImpl(KookChannel.kt:164)
        at love.forte.simbot.component.kook.KookChannel.send(KookChannel.kt)
        at love.forte.simbot.component.kook.KookChannel.send$default(KookChannel.kt:163)
        at love.forte.simbot.component.kook.KookChannel$sendBlocking$1.invokeSuspend(KookChannel.kt:226)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:835)

使用发送Message的方法时:

love.forte.simbot.event.EventListenerProcessingException: java.lang.NullPointerException
        at love.forte.simbot.core.event.ListenerInvoker.invoke(SimpleEventListenerManagerImpl.kt:456)
        at love.forte.simbot.core.event.ListenerInvoker$invoke$1.invokeSuspend(SimpleEventListenerManagerImpl.kt)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Caused by: java.lang.NullPointerException
        at love.forte.simbot.component.kook.internal.KookGuildImpl.getBot(KookGuildImpl.kt:87)
        at love.forte.simbot.component.kook.internal.KookChannelImpl.getBot(KookChannelImpl.kt:57)
        at love.forte.simbot.component.kook.internal.KookChannelImpl.send(KookChannelImpl.kt:85)
        at love.forte.simbot.component.kook.KookChannel.send$default(KookChannel.kt:178)
        at love.forte.simbot.component.kook.KookChannel$sendBlocking$2.invokeSuspend(KookChannel.kt:236)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:835)

消息转发无法直接转发图片

如果直接原样发送图片类型的消息将无法转发:

channel.send(event.messageContent)

这会提示资源不存在,需要重新上传资源。但是此资源链接(貌似)可以直接使用在卡片消息中,因此仅需要对消息转发情况做处理,可能需要涉及内部链接缓存。

此问题在Kook开发者中心中有所反馈,但是对此问题的调整意向不大,可能不会被官方改善。

ヘキソナ#6969:
你放在卡片消息里发出去就行

由回复得知图片链接似乎可直接被卡片消息使用。

ヘキソナ#6969:
这种东西从来都是开发者自己实现吧…
加糖可以,但是加到最后甜到发齁,你的sdk就有点太臃肿了
ヘキソナ#6969:
关于优化这一点我觉得这种操作几乎可以忽略不计,你又不是在打OI…(其实就算是OI这么几个指令的时间也解决不了TLE)…所以最后唯一的作用还只是语法糖

以目前的讨论结果来看,操作调整的可能性不大。

3.0.0.0.preview.1.1无法接收消息

版本:

         <dependency>
            <groupId>love.forte.simbot.boot</groupId>
            <artifactId>simboot-core</artifactId>
            <version>3.0.0.preview.7.0</version>
         </dependency>
		<dependency>
            <groupId>love.forte.simbot.component</groupId>
            <artifactId>simbot-component-kaiheila-boot</artifactId>
            <version>3.0.0.0.preview.1.1</version>
         </dependency>

问题描述: 收到私聊/频道消息时,直接抛出异常,无法触发任何监听.

错误日志:

2022-04-28 10:03:53.798 ERROR 13792 --- [atcher-worker-2] l.f.s.k.bot.client.OPYfwS3t0hPuVZZx      : Event pre precess failed.

kotlinx.serialization.json.internal.JsonDecodingException: Polymorphic serializer was not found for missing class discriminator ('null')
JSON input: .....es":[],"is_vip":false,"is_ai_reduce_noise":true,"bot":false}
	at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:24) ~[kotlinx-serialization-json-jvm-1.3.1.jar:na]
	at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:32) ~[kotlinx-serialization-json-jvm-1.3.1.jar:na]
	at kotlinx.serialization.json.internal.PolymorphicKt.throwSerializerNotFound(Polymorphic.kt:76) ~[kotlinx-serialization-json-jvm-1.3.1.jar:na]
	at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:66) ~[kotlinx-serialization-json-jvm-1.3.1.jar:na]
	at kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeSerializableValue(TreeJsonDecoder.kt:51) ~[kotlinx-serialization-json-jvm-1.3.1.jar:na]
	at kotlinx.serialization.internal.TaggedDecoder.decodeSerializableValue(Tagged.kt:206) ~[kotlinx-serialization-core-jvm-1.3.1.jar:1.3.1]
	at kotlinx.serialization.internal.TaggedDecoder$decodeSerializableElement$1.invoke(Tagged.kt:279) ~[kotlinx-serialization-core-jvm-1.3.1.jar:1.3.1]
	at kotlinx.serialization.internal.TaggedDecoder.tagBlock(Tagged.kt:296) ~[kotlinx-serialization-core-jvm-1.3.1.jar:1.3.1]
	at kotlinx.serialization.internal.TaggedDecoder.decodeSerializableElement(Tagged.kt:279) ~[kotlinx-serialization-core-jvm-1.3.1.jar:1.3.1]
	at love.forte.simbot.kaiheila.event.message.KMarkdownEventExtraImpl$$serializer.deserialize(KMarkdownEventExtra.kt:54) ~[simbot-component-kaiheila-api-3.0.0.0.preview.1.1.jar:na]
	at love.forte.simbot.kaiheila.event.message.KMarkdownEventExtraImpl$$serializer.deserialize(KMarkdownEventExtra.kt:54) ~[simbot-component-kaiheila-api-3.0.0.0.preview.1.1.jar:na]
	at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:59) ~[kotlinx-serialization-json-jvm-1.3.1.jar:na]
	at kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeSerializableValue(TreeJsonDecoder.kt:51) ~[kotlinx-serialization-json-jvm-1.3.1.jar:na]
	at kotlinx.serialization.internal.TaggedDecoder.decodeSerializableValue(Tagged.kt:206) ~[kotlinx-serialization-core-jvm-1.3.1.jar:1.3.1]
	at kotlinx.serialization.internal.TaggedDecoder$decodeSerializableElement$1.invoke(Tagged.kt:279) ~[kotlinx-serialization-core-jvm-1.3.1.jar:1.3.1]
	at kotlinx.serialization.internal.TaggedDecoder.tagBlock(Tagged.kt:296) ~[kotlinx-serialization-core-jvm-1.3.1.jar:1.3.1]
	at kotlinx.serialization.internal.TaggedDecoder.decodeSerializableElement(Tagged.kt:279) ~[kotlinx-serialization-core-jvm-1.3.1.jar:1.3.1]
	at love.forte.simbot.kaiheila.event.message.MessageEventImpl$$serializer.deserialize(MessageEvents.kt:64) ~[simbot-component-kaiheila-api-3.0.0.0.preview.1.1.jar:na]
	at love.forte.simbot.kaiheila.event.message.MessageEventImpl$$serializer.deserialize(MessageEvents.kt:64) ~[simbot-component-kaiheila-api-3.0.0.0.preview.1.1.jar:na]
	at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:59) ~[kotlinx-serialization-json-jvm-1.3.1.jar:na]
	at kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeSerializableValue(TreeJsonDecoder.kt:51) ~[kotlinx-serialization-json-jvm-1.3.1.jar:na]
	at kotlinx.serialization.json.internal.TreeJsonDecoderKt.readJson(TreeJsonDecoder.kt:24) ~[kotlinx-serialization-json-jvm-1.3.1.jar:na]
	at kotlinx.serialization.json.Json.decodeFromJsonElement(Json.kt:119) ~[kotlinx-serialization-json-jvm-1.3.1.jar:na]
	at love.forte.simbot.kaiheila.event.MessageEventParser.deserialize(EventSignals.kt:71) ~[simbot-component-kaiheila-api-3.0.0.0.preview.1.1.jar:na]
	at love.forte.simbot.kaiheila.event.MessageEventParser.deserialize(EventSignals.kt:61) ~[simbot-component-kaiheila-api-3.0.0.0.preview.1.1.jar:na]
	at love.forte.simbot.kaiheila.internal.KaiheilaBotImpl$processEvent$3$lazy$1.invoke(KaiheilaBotImpl.kt:291) ~[simbot-component-kaiheila-stdlib-3.0.0.0.preview.1.1.jar:na]
	at love.forte.simbot.kaiheila.internal.KaiheilaBotImpl$processEvent$3$lazy$1.invoke(KaiheilaBotImpl.kt:290) ~[simbot-component-kaiheila-stdlib-3.0.0.0.preview.1.1.jar:na]
	at kotlin.SafePublicationLazyImpl.getValue(LazyJVM.kt:107) ~[kotlin-stdlib-1.6.10.jar:1.6.10-release-923(1.6.10)]
	at love.forte.simbot.kaiheila.internal.KaiheilaBotImpl$processEvent$3$lazyDecoded$1.get(KaiheilaBotImpl.kt:295) ~[simbot-component-kaiheila-stdlib-3.0.0.0.preview.1.1.jar:na]
	at kotlin.jvm.internal.PropertyReference0.invoke(PropertyReference0.java:35) ~[kotlin-stdlib-1.6.10.jar:1.6.10-release-923(1.6.10)]
	at love.forte.simbot.component.kaiheila.internal.KaiheilaComponentBotImpl$1.invokeSuspend(KaiheilaComponentBotImpl.kt:99) ~[simbot-component-kaiheila-core-3.0.0.0.preview.1.1.jar:na]
	at love.forte.simbot.component.kaiheila.internal.KaiheilaComponentBotImpl$1.invoke(KaiheilaComponentBotImpl.kt) ~[simbot-component-kaiheila-core-3.0.0.0.preview.1.1.jar:na]
	at love.forte.simbot.component.kaiheila.internal.KaiheilaComponentBotImpl$1.invoke(KaiheilaComponentBotImpl.kt) ~[simbot-component-kaiheila-core-3.0.0.0.preview.1.1.jar:na]
	at love.forte.simbot.kaiheila.internal.KaiheilaBotImpl$processEvent$3.invokeSuspend(KaiheilaBotImpl.kt:300) ~[simbot-component-kaiheila-stdlib-3.0.0.0.preview.1.1.jar:na]
	at love.forte.simbot.kaiheila.internal.KaiheilaBotImpl$processEvent$3.invoke(KaiheilaBotImpl.kt) ~[simbot-component-kaiheila-stdlib-3.0.0.0.preview.1.1.jar:na]
	at love.forte.simbot.kaiheila.internal.KaiheilaBotImpl$processEvent$3.invoke(KaiheilaBotImpl.kt) ~[simbot-component-kaiheila-stdlib-3.0.0.0.preview.1.1.jar:na]
	at kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2.emit(Collect.kt:136) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at love.forte.simbot.kaiheila.internal.KaiheilaBotImpl$processEvent$$inlined$mapNotNull$1$2.emit(Emitters.kt:237) ~[simbot-component-kaiheila-stdlib-3.0.0.0.preview.1.1.jar:na]
	at kotlinx.coroutines.flow.FlowKt__ChannelsKt.emitAllImpl$FlowKt__ChannelsKt(Channels.kt:62) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.flow.FlowKt__ChannelsKt.access$emitAllImpl$FlowKt__ChannelsKt(Channels.kt:1) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.flow.FlowKt__ChannelsKt$emitAllImpl$1.invokeSuspend(Channels.kt) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[kotlin-stdlib-1.6.10.jar:1.6.10-release-923(1.6.10)]
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]


优化频道列表获取

考虑core模块中,不再将 is_category=true 的频道视为频道,而是作为分组融合到真正的频道中。

消息事件中的Text未正确移除mention消息字符串

例如一个消息:

@法欧莉 今天的我

其中存在一个mention @法欧莉,但是最终的消息链中的 Text 结果依然为 (met)xxxxxxx(met) 今天的我,而实际目标应当移除其中的 (met)xxxx(met) (但是不会处理空格,需要注意) 。

kaiheila组件发送消息时会抛出异常

组件: simbot-component-kaiheila-boot
版本: 3.0.0.0.preview.1.1
问题: 发送channel与contant消息时均会抛出此异常, 消息实际发送成功

`onGroup
2022-04-19 15:50:11.683 ERROR 13080 --- [atcher-worker-1] l.f.s.k.bot.client.OPYfwS3t0hPuVZZx      : Unknown event type: KMD. data: Event(s=0, d={"channel_type":"GROUP","type":9,"target_id":"4587833303764121","author_id":"2371258185","content":"我是RBQ","extra":{"type":1,"code":"","guild_id":"8582739890554982","channel_name":"查价bot (机器人)","author":{"id":"2371258185","username":"芦苇测试机","identify_num":"5173","online":true,"os":"Websocket","status":0,"avatar":"https://img.kaiheila.cn/assets/bot.png/icon","vip_avatar":"https://img.kaiheila.cn/assets/bot.png/icon","banner":"","nickname":"芦苇测试机","roles":[2842315],"is_vip":false,"is_ai_reduce_noise":false,"bot":true,"tag_info":{"color":"#34A853","text":"机器人"},"client_id":"OPYfwS3t0hPuVZZx"},"mention":[],"mention_all":false,"mention_roles":[],"mention_here":false,"nav_channels":[],"kmarkdown":{"raw_content":"我是RBQ","mention_part":[],"mention_role_part":[]},"last_msg_content":"芦苇测试机:我是RBQ"},"msg_id":"ee8b14c1-22eb-44d3-bb65-a1274ade96db","msg_timestamp":1650354611204,"nonce":"","from_type":1}, sn=2)

love.forte.simbot.SimbotIllegalStateException: Unknown event type: KMD. data: Event(s=0, d={"channel_type":"GROUP","type":9,"target_id":"4587833303764121","author_id":"2371258185","content":"我是RBQ","extra":{"type":1,"code":"","guild_id":"8582739890554982","channel_name":"查价bot (机器人)","author":{"id":"2371258185","username":"芦苇测试机","identify_num":"5173","online":true,"os":"Websocket","status":0,"avatar":"https://img.kaiheila.cn/assets/bot.png/icon","vip_avatar":"https://img.kaiheila.cn/assets/bot.png/icon","banner":"","nickname":"芦苇测试机","roles":[2842315],"is_vip":false,"is_ai_reduce_noise":false,"bot":true,"tag_info":{"color":"#34A853","text":"机器人"},"client_id":"OPYfwS3t0hPuVZZx"},"mention":[],"mention_all":false,"mention_roles":[],"mention_here":false,"nav_channels":[],"kmarkdown":{"raw_content":"我是RBQ","mention_part":[],"mention_role_part":[]},"last_msg_content":"芦苇测试机:我是RBQ"},"msg_id":"ee8b14c1-22eb-44d3-bb65-a1274ade96db","msg_timestamp":1650354611204,"nonce":"","from_type":1}, sn=2)
	at love.forte.simbot.kaiheila.internal.KaiheilaBotImpl$processEvent$3.invokeSuspend(KaiheilaBotImpl.kt:284) ~[simbot-component-kaiheila-stdlib-3.0.0.0.preview.1.1.jar:na]
	at love.forte.simbot.kaiheila.internal.KaiheilaBotImpl$processEvent$3.invoke(KaiheilaBotImpl.kt) ~[simbot-component-kaiheila-stdlib-3.0.0.0.preview.1.1.jar:na]
	at love.forte.simbot.kaiheila.internal.KaiheilaBotImpl$processEvent$3.invoke(KaiheilaBotImpl.kt) ~[simbot-component-kaiheila-stdlib-3.0.0.0.preview.1.1.jar:na]
	at kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2.emit(Collect.kt:136) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at love.forte.simbot.kaiheila.internal.KaiheilaBotImpl$processEvent$$inlined$mapNotNull$1$2.emit(Emitters.kt:237) ~[simbot-component-kaiheila-stdlib-3.0.0.0.preview.1.1.jar:na]
	at kotlinx.coroutines.flow.FlowKt__ChannelsKt.emitAllImpl$FlowKt__ChannelsKt(Channels.kt:62) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.flow.FlowKt__ChannelsKt.access$emitAllImpl$FlowKt__ChannelsKt(Channels.kt:1) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.flow.FlowKt__ChannelsKt$emitAllImpl$1.invokeSuspend(Channels.kt) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[kotlin-stdlib-1.6.10.jar:1.6.10-release-923(1.6.10)]
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]`

对消息事件文本做处理

处理接收到的消息事件的 KMarkdown 中的纯文本部分并移除多余字符,转化为消息链。目前似乎没有正确处理纯文本消息。

消息链中不再保留原始的 KMarkdown 正文,将会转移到 MessageContent 中。

开黑啦重命名为 `Kook`

开黑啦 (https://www.kaiheila.cn/) 官方已更名为 Kook (https://www.kookapp.cn/) 。

因此本仓库会跟随官方进行变化,包括:

  • 仓库名simbot-component-kaiheila -> simbot-component-kook
  • 坐标名love.forte.simbot.component:simbot-component-kaiheila-xxx -> love.forte.simbot.component:simbot-component-kook-xxx
  • 类命名。所有涉及到以 Kaiheila*Khl* 形式命名的类型全部重命名为 Kook*。例如:KaiheilaFoo -> KookFoo
  • 其他。其他一切上述条目中未涉及或被忽略的与命名相关的内容。

kotlinx.serialization.MissingFieldException: Fields [user_id, channel_id] are required for type with serial name 'love.forte.simbot.kook.event.system.user.UserExitedChannelEventBodyImpl', but they were missing

Event pre precess failure.
kotlinx.serialization.MissingFieldException: Fields [user_id, channel_id] are required for type with serial name 'love.forte.simbot.kook.event.system.user.UserExitedChannelEventBodyImpl', but they were missing
        at kotlinx.serialization.internal.PluginExceptionsKt.throwMissingFieldException(PluginExceptions.kt:20)
        at love.forte.simbot.kook.event.system.user.UserExitedChannelEventBodyImpl.<init>(UserExitedChannelEvent.kt:56)
        at love.forte.simbot.kook.event.system.user.UserExitedChannelEventBodyImpl$$serializer.deserialize(UserExitedChannelEvent.kt:56)
        at love.forte.simbot.kook.event.system.user.UserExitedChannelEventBodyImpl$$serializer.deserialize(UserExitedChannelEvent.kt:56)
        at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:59)
        at kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeSerializableValue(TreeJsonDecoder.kt:51)
        at kotlinx.serialization.internal.TaggedDecoder.decodeSerializableValue(Tagged.kt:207)
        at kotlinx.serialization.internal.TaggedDecoder$decodeSerializableElement$1.invoke(Tagged.kt:280)
        at kotlinx.serialization.internal.TaggedDecoder.tagBlock(Tagged.kt:297)
        at kotlinx.serialization.internal.TaggedDecoder.decodeSerializableElement(Tagged.kt:280)
        at love.forte.simbot.kook.event.system.SimpleSystemEventExtra$$serializer.deserialize(SystemEvent.kt:79)
        at love.forte.simbot.kook.event.system.SimpleSystemEventExtra$$serializer.deserialize(SystemEvent.kt:79)
        at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:59)
        at kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeSerializableValue(TreeJsonDecoder.kt:51)
        at kotlinx.serialization.internal.TaggedDecoder.decodeSerializableValue(Tagged.kt:207)
        at kotlinx.serialization.internal.TaggedDecoder$decodeSerializableElement$1.invoke(Tagged.kt:280)
        at kotlinx.serialization.internal.TaggedDecoder.tagBlock(Tagged.kt:297)
        at kotlinx.serialization.internal.TaggedDecoder.decodeSerializableElement(Tagged.kt:280)
        at love.forte.simbot.kook.event.system.SystemEventImpl$$serializer.deserialize(SystemEvent.kt:83)
        at love.forte.simbot.kook.event.system.SystemEventImpl$$serializer.deserialize(SystemEvent.kt:83)
        at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:59)
        at kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeSerializableValue(TreeJsonDecoder.kt:51)
        at kotlinx.serialization.json.internal.TreeJsonDecoderKt.readJson(TreeJsonDecoder.kt:24)
        at kotlinx.serialization.json.Json.decodeFromJsonElement(Json.kt:119)
        at love.forte.simbot.kook.event.SysEventParser.deserialize(EventSignals.kt:96)
        at love.forte.simbot.kook.event.SysEventParser.deserialize(EventSignals.kt:83)
        at love.forte.simbot.kook.internal.KookBotImpl$eventProcessJob$launchJob$1$lazy$1.invoke(KookBotImpl.kt:741)
        at love.forte.simbot.kook.internal.KookBotImpl$eventProcessJob$launchJob$1$lazy$1.invoke(KookBotImpl.kt:740)
        at kotlin.SafePublicationLazyImpl.getValue(LazyJVM.kt:107)
        at love.forte.simbot.kook.internal.KookBotImpl$eventProcessJob$launchJob$1$lazyDecoded$1.get(KookBotImpl.kt:744)
        at kotlin.jvm.internal.PropertyReference0.invoke(PropertyReference0.java:35)
        at love.forte.simbot.component.kook.internal.KookComponentBotImpl$1.invokeSuspend(KookComponentBotImpl.kt:114)
        at love.forte.simbot.component.kook.internal.KookComponentBotImpl$1.invoke(KookComponentBotImpl.kt)
        at love.forte.simbot.component.kook.internal.KookComponentBotImpl$1.invoke(KookComponentBotImpl.kt)
        at love.forte.simbot.kook.internal.KookBotImpl$eventProcessJob$launchJob$1.invokeSuspend(KookBotImpl.kt:749)
        at love.forte.simbot.kook.internal.KookBotImpl$eventProcessJob$launchJob$1.invoke(KookBotImpl.kt)
        at love.forte.simbot.kook.internal.KookBotImpl$eventProcessJob$launchJob$1.invoke(KookBotImpl.kt)
        at kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2.emit(Emitters.kt:223)
        at kotlinx.coroutines.flow.FlowKt__ChannelsKt.emitAllImpl$FlowKt__ChannelsKt(Channels.kt:62)
        at kotlinx.coroutines.flow.FlowKt__ChannelsKt.access$emitAllImpl$FlowKt__ChannelsKt(Channels.kt:1)
        at kotlinx.coroutines.flow.FlowKt__ChannelsKt$emitAllImpl$1.invokeSuspend(Channels.kt)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

但是这两个属性文档里都有,待确认原因

CardMessage序列化问题

组件: simbot-component-kaiheila-boot
版本: 3.0.0.0.preview.1.2
问题: 发送channel与contant消息时均会抛出此异常, 消息实际发送成功

代码:

    public void testGroup(ChannelMessageEvent channelMessageEvent) {
        Channel channel = channelMessageEvent.getChannel();
        ArrayList<Card.Module> modules = new ArrayList<>();
        modules.add(new Card.Module.Header("test"));
        channel.sendBlocking(new love.forte.simbot.component.kaiheila.message.CardMessage(new CardMessage(modules)));
    }

log:

2022-04-24 11:56:48.509 ERROR 4416 --- [         task-3] c.c.tyche.khl.listener.AllListener       : Listener process failed: love.forte.simbot.event.EventListenerProcessingException: kotlinx.serialization.SerializationException: Class 'Header' is not registered for polymorphic serialization in the scope of 'Card'.
Mark the base class as 'sealed' or register the serializer explicitly.

love.forte.simbot.event.EventListenerProcessingException: kotlinx.serialization.SerializationException: Class 'Header' is not registered for polymorphic serialization in the scope of 'Card'.
Mark the base class as 'sealed' or register the serializer explicitly.
	at love.forte.simbot.core.event.CoreListenerManager$ListenerInvoker.invoke(CoreListenerManager.kt:348) ~[simbot-core-3.0.0.preview.7.0.jar:na]
	at love.forte.simbot.core.event.CoreListenerManager$ListenerInvoker$invoke$1.invokeSuspend(CoreListenerManager.kt) ~[simbot-core-3.0.0.preview.7.0.jar:na]
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[kotlin-stdlib-1.6.10.jar:1.6.10-release-923(1.6.10)]
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
	at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]
Caused by: kotlinx.serialization.SerializationException: Class 'Header' is not registered for polymorphic serialization in the scope of 'Card'.
Mark the base class as 'sealed' or register the serializer explicitly.
	at kotlinx.serialization.internal.AbstractPolymorphicSerializerKt.throwSubtypeNotRegistered(AbstractPolymorphicSerializer.kt:102) ~[kotlinx-serialization-core-jvm-1.3.1.jar:1.3.1]
	at kotlinx.serialization.internal.AbstractPolymorphicSerializerKt.throwSubtypeNotRegistered(AbstractPolymorphicSerializer.kt:113) ~[kotlinx-serialization-core-jvm-1.3.1.jar:1.3.1]
	at kotlinx.serialization.PolymorphicSerializerKt.findPolymorphicSerializer(PolymorphicSerializer.kt:109) ~[kotlinx-serialization-core-jvm-1.3.1.jar:1.3.1]
	at kotlinx.serialization.json.internal.StreamingJsonEncoder.encodeSerializableValue(StreamingJsonEncoder.kt:224) ~[kotlinx-serialization-json-jvm-1.3.1.jar:na]
	at kotlinx.serialization.encoding.AbstractEncoder.encodeSerializableElement(AbstractEncoder.kt:80) ~[kotlinx-serialization-core-jvm-1.3.1.jar:1.3.1]
	at kotlinx.serialization.internal.ListLikeSerializer.serialize(CollectionSerializers.kt:69) ~[kotlinx-serialization-core-jvm-1.3.1.jar:1.3.1]
	at love.forte.simbot.kaiheila.objects.CardMessageSerializer.serialize(Card.kt:106) ~[simbot-component-kaiheila-api-3.0.0.0.preview.1.1.jar:na]
	at love.forte.simbot.kaiheila.objects.CardMessageSerializer.serialize(Card.kt:93) ~[simbot-component-kaiheila-api-3.0.0.0.preview.1.1.jar:na]
	at kotlinx.serialization.json.internal.StreamingJsonEncoder.encodeSerializableValue(StreamingJsonEncoder.kt:219) ~[kotlinx-serialization-json-jvm-1.3.1.jar:na]
	at kotlinx.serialization.json.Json.encodeToString(Json.kt:85) ~[kotlinx-serialization-json-jvm-1.3.1.jar:na]
	at love.forte.simbot.kaiheila.objects.CardMessage.decode(Card.kt:77) ~[simbot-component-kaiheila-api-3.0.0.0.preview.1.1.jar:na]
	at love.forte.simbot.kaiheila.objects.CardMessage.decode$default(Card.kt:76) ~[simbot-component-kaiheila-api-3.0.0.0.preview.1.1.jar:na]
	at love.forte.simbot.component.kaiheila.message.KaiheilaMessagesKt.elementToRequestOrNull(KaiheilaMessages.kt:139) ~[simbot-component-kaiheila-core-3.0.0.0.preview.1.1.jar:na]
	at love.forte.simbot.component.kaiheila.message.KaiheilaMessagesKt.toRequest(KaiheilaMessages.kt:88) ~[simbot-component-kaiheila-core-3.0.0.0.preview.1.1.jar:na]
	at love.forte.simbot.component.kaiheila.message.KaiheilaMessagesKt.toRequest$default(KaiheilaMessages.kt:81) ~[simbot-component-kaiheila-core-3.0.0.0.preview.1.1.jar:na]
	at love.forte.simbot.component.kaiheila.internal.KaiheilaChannelImpl.send(KaiheilaChannelImpl.kt:87) ~[simbot-component-kaiheila-core-3.0.0.0.preview.1.1.jar:na]
	at love.forte.simbot.component.kaiheila.KaiheilaChannel$sendBlocking$2.invokeSuspend(KaiheilaChannel.kt:211) ~[simbot-component-kaiheila-core-3.0.0.0.preview.1.1.jar:na]
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[kotlin-stdlib-1.6.10.jar:1.6.10-release-923(1.6.10)]
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at love.forte.simbot.utils.BlockingRunnerKt.runInBlocking(BlockingRunner.kt:34) ~[simbot-api-3.0.0.preview.7.0.jar:na]
	at love.forte.simbot.utils.BlockingRunnerKt.runInBlocking$default(BlockingRunner.kt:31) ~[simbot-api-3.0.0.preview.7.0.jar:na]
	at love.forte.simbot.component.kaiheila.KaiheilaChannel.sendBlocking(KaiheilaChannel.kt:211) ~[simbot-component-kaiheila-core-3.0.0.0.preview.1.1.jar:na]
	at love.forte.simbot.component.kaiheila.KaiheilaChannel.sendBlocking(KaiheilaChannel.kt:231) ~[simbot-component-kaiheila-core-3.0.0.0.preview.1.1.jar:na]
	at com.catcraft.tyche.khl.listener.AllListener.testGroup(AllListener.java:45) ~[classes/:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
	at kotlin.reflect.jvm.internal.calls.CallerImpl$Method.callMethod(CallerImpl.kt:97) ~[kotlin-reflect-1.6.10.jar:1.6.10-release-923(1.6.10)]
	at kotlin.reflect.jvm.internal.calls.CallerImpl$Method$Instance.call(CallerImpl.kt:113) ~[kotlin-reflect-1.6.10.jar:1.6.10-release-923(1.6.10)]
	at kotlin.reflect.jvm.internal.KCallableImpl.call(KCallableImpl.kt:108) ~[kotlin-reflect-1.6.10.jar:1.6.10-release-923(1.6.10)]
	at love.forte.simboot.listener.FunctionalBindableEventListener$invoke$$inlined$runWithInterruptible$default$1.invoke(Runner.kt:40) ~[simboot-api-3.0.0.preview.7.0.jar:na]
	at kotlinx.coroutines.InterruptibleKt.runInterruptibleInExpectedContext(Interruptible.kt:46) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.InterruptibleKt.access$runInterruptibleInExpectedContext(Interruptible.kt:1) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.InterruptibleKt$runInterruptible$2.invokeSuspend(Interruptible.kt:38) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[kotlin-stdlib-1.6.10.jar:1.6.10-release-923(1.6.10)]
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) ~[kotlinx-coroutines-core-jvm-1.5.2.jar:na]


无法解析 `SYS_MSG` 类型事件

在私聊中邀请bot时出现。

Session flow on error: Unknown event type property: "SYS_MSG"
love.forte.simbot.kook.event.KookSignalException: Unknown event type property: "SYS_MSG"
        at love.forte.simbot.kook.internal.KookBotImpl$processEvent$3.invokeSuspend(KookBotImpl.kt:540)
        at love.forte.simbot.kook.internal.KookBotImpl$processEvent$3.invoke(KookBotImpl.kt)
        at love.forte.simbot.kook.internal.KookBotImpl$processEvent$3.invoke(KookBotImpl.kt)
        at kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2.emit(Emitters.kt:223)
        at love.forte.simbot.kook.internal.KookBotImpl$processEvent$$inlined$mapNotNull$1$2.emit(Emitters.kt:237)
        at kotlinx.coroutines.flow.FlowKt__ChannelsKt.emitAllImpl$FlowKt__ChannelsKt(Channels.kt:62)
        at kotlinx.coroutines.flow.FlowKt__ChannelsKt.access$emitAllImpl$FlowKt__ChannelsKt(Channels.kt:1)
        at kotlinx.coroutines.flow.FlowKt__ChannelsKt$emitAllImpl$1.invokeSuspend(Channels.kt)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.