simple-robot / simbot-component-kook

一个 Kotlin 多平台的 KOOK(开黑啦) Bot SDK 实现库,一个 Simple Robot 组件库,Java 友好、异步高效~ ❤️‍🔥❤️‍🔥😘
https://simbot.forte.love/component-kook.html
GNU Lesser General Public License v3.0
19 stars 1 forks source link

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

Closed khjxiaogu closed 1 year ago

khjxiaogu commented 1 year ago

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

[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)
khjxiaogu commented 1 year ago

抱歉,没注意到最新版本是alpha-1