自定义调用API插件
-
需要发第二遍才能正常使用api,第一次报错日志
[0m2022-11-09 16:06:33 V/Bot.1782443084: [相亲相爱的数码人(398128418)] kogeki攻攻(981612327) -> 今天我是什么少女�[0m�[m [31m2022-11-09 16:06:33 E/Bot.1782443084: java.lang.IllegalStateException: Exception while broadcasting event 'GroupMessageEvent' java.lang.IllegalStateException: Exception while broadcasting event 'GroupMessageEvent' at net.mamoe.mirai.internal.network.components.EventDispatcherImpl.broadcast$suspendImpl(EventDispatcher.kt:103) at net.mamoe.mirai.internal.network.components.EventDispatcherImpl$broadcast$1.invokeSuspend(EventDispatcher.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.UndispatchedCoroutine.afterResume(CoroutineContext.kt:202) at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) 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:749) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) Caused by: java.lang.IllegalStateException: 未找到异常处理器. 请继承 SimpleListenerHost 中的 handleException 方法, 或在构造 SimpleListenerHost 时提供 CoroutineExceptionHandler ------------ Cannot find exception handler from coroutineContext. Please extend SimpleListenerHost.handleException or provide a CoroutineExceptionHandler to the constructor of SimpleListenerHost at net.mamoe.mirai.event.SimpleListenerHost.handleException(JvmMethodListeners.kt:192) at MiraiCallApiPlugin-v2.8.jar//io.github.gdpl2112.mirai.p1.CallApiPlugin$1.handleException(CallApiPlugin.java:46) at net.mamoe.mirai.event.SimpleListenerHost$special$$inlined$CoroutineExceptionHandler$1.handleException(CoroutineExceptionHandler.kt:111) at net.mamoe.mirai.internal.event.SafeListener.onEvent(SafeListener.kt:75) at net.mamoe.mirai.internal.event.SafeListener$onEvent$1.invokeSuspend(SafeListener.kt) ... 9 more Caused by: net.mamoe.mirai.event.ExceptionInEventHandlerException: Exception in EventHandler at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt.registerEventHandler$callMethod$invokeWithErrorReport(JvmMethodListenersInternal.kt:147) at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt.access$registerEventHandler$callMethod$invokeWithErrorReport(JvmMethodListenersInternal.kt:1) at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt$registerEventHandler$callMethod$2.invokeSuspend(JvmMethodListenersInternal.kt:154) 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) ... 4 more Caused by: java.lang.reflect.InvocationTargetException at jdk.internal.reflect.GeneratedMethodAccessor68.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt.registerEventHandler$callMethod$invokeWithErrorReport(JvmMethodListenersInternal.kt:140) ... 10 more Caused by: java.lang.NoClassDefFoundError: Could not initialize class io.github.kloping.clasz.ClassUtils at lib-tts.jar//io.github.kloping.serialize.HMLObject.getFields(HMLObject.java:276) at lib-tts.jar//io.github.kloping.serialize.HMLObject.work(HMLObject.java:81) at lib-tts.jar//io.github.kloping.serialize.HMLObject.toHMLString(HMLObject.java:75) at MiraiCallApiPlugin-v2.8.jar//io.github.gdpl2112.mirai.p1.ManagerConf.apply(ManagerConf.java:64) at MiraiCallApiPlugin-v2.8.jar//io.github.gdpl2112.mirai.p1.ManagerConf.getStateByTouchAndIdDefault(ManagerConf.java:45) at MiraiCallApiPlugin-v2.8.jar//io.github.gdpl2112.mirai.p1.Worker.enable(Worker.java:113) at MiraiCallApiPlugin-v2.8.jar//io.github.gdpl2112.mirai.p1.Worker.call(Worker.java:95) at MiraiCallApiPlugin-v2.8.jar//io.github.gdpl2112.mirai.p1.CallApiPlugin$1.onMessage0(CallApiPlugin.java:74) at MiraiCallApiPlugin-v2.8.jar//io.github.gdpl2112.mirai.p1.CallApiPlugin$1.onMessage(CallApiPlugin.java:51) ... 14 more
-
-
@Kloping 有的大佬,我一直在用你的autoreply插件,之前塞过
-
此回复已被删除! -
大佬,我用这个插件发第一遍会报错,和上面那位有点像?我也已经把lib-tts.jar放到plugins里了
发第二遍信息时不会在控制台报错但机器人会秒回“未来天气查询失败”这样的信息,我不知道是不是我的问题或是api的问题,api用的就是您在文末写的那些。麻烦大佬能帮我看下是哪出问题了吗?
这是报错的日志文件2022-12-31 16:54:08 V/Bot.1705609074: [没名字的群就是好群(1061257810)] (209858 1065) -> 星座运势 2022-12-31 16:54:08 E/Bot.1705609074: java.lang.IllegalStateException: Exception while broadcasting event 'GroupMessageEvent' java.lang.IllegalStateException: Exception while broadcasting event 'GroupMessag eEvent' at net.mamoe.mirai.internal.network.components.EventDispatcherImpl.broad cast$suspendImpl(EventDispatcher.kt:104) at net.mamoe.mirai.internal.network.components.EventDispatcherImpl$broad cast$1.invokeSuspend(EventDispatcher.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(Contin uationImpl.kt:33) at kotlinx.coroutines.UndispatchedCoroutine.afterResume(CoroutineContext .kt:233) at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt: 102) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(Contin uationImpl.kt:46) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineS cheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(C oroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(Cor outineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(Coroutine Scheduler.kt:664) Caused by: java.lang.IllegalStateException: 未找到异常处理器. 请继承 SimpleListe nerHost 中的 handleException 方法, 或在构造 SimpleListenerHost 时提供 CoroutineE xceptionHandler ------------ Cannot find exception handler from coroutineContext. Please extend SimpleListenerHost.handleException or provide a CoroutineException Handler to the constructor of SimpleListenerHost at net.mamoe.mirai.event.SimpleListenerHost.handleException(JvmMethodLis teners.kt:192) at MiraiCallApiPlugin-v2.8.1.jar//io.github.gdpl2112.mirai.p1.CallApiPlu gin$1.handleException(CallApiPlugin.java:46) at net.mamoe.mirai.event.SimpleListenerHost$special$$inlined$CoroutineEx ceptionHandler$1.handleException(CoroutineExceptionHandler.kt:111) at net.mamoe.mirai.internal.event.SafeListener.onEvent(SafeListener.kt:7 5) at net.mamoe.mirai.internal.event.SafeListener$onEvent$1.invokeSuspend(S afeListener.kt) ... 9 more Caused by: net.mamoe.mirai.event.ExceptionInEventHandlerException: Exception in EventHandler at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt.registerE ventHandler$callMethod$invokeWithErrorReport(JvmMethodListenersInternal.kt:147) at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt.access$re gisterEventHandler$callMethod$invokeWithErrorReport(JvmMethodListenersInternal.k t:1) at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt$registerE ventHandler$callMethod$2.invokeSuspend(JvmMethodListenersInternal.kt:154) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(Contin uationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.k t:42) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) ... 4 more Caused by: java.lang.reflect.InvocationTargetException at jdk.internal.reflect.GeneratedMethodAccessor52.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt.registerE ventHandler$callMethod$invokeWithErrorReport(JvmMethodListenersInternal.kt:140) ... 10 more Caused by: java.lang.NoClassDefFoundError: Could not initialize class io.github. kloping.clasz.ClassUtils at lib-tts.jar//io.github.kloping.serialize.HMLObject.getFields(HMLObjec t.java:276) at lib-tts.jar//io.github.kloping.serialize.HMLObject.work(HMLObject.jav a:81) at lib-tts.jar//io.github.kloping.serialize.HMLObject.toHMLString(HMLObj ect.java:75) at MiraiCallApiPlugin-v2.8.1.jar//io.github.gdpl2112.mirai.p1.ManagerCon f.apply(ManagerConf.java:64) at MiraiCallApiPlugin-v2.8.1.jar//io.github.gdpl2112.mirai.p1.ManagerCon f.getStateByTouchAndIdDefault(ManagerConf.java:52) at MiraiCallApiPlugin-v2.8.1.jar//io.github.gdpl2112.mirai.p1.Worker.ena ble(Worker.java:113) at MiraiCallApiPlugin-v2.8.1.jar//io.github.gdpl2112.mirai.p1.Worker.cal l(Worker.java:95) at MiraiCallApiPlugin-v2.8.1.jar//io.github.gdpl2112.mirai.p1.CallApiPlu gin$1.onMessage0(CallApiPlugin.java:74) at MiraiCallApiPlugin-v2.8.1.jar//io.github.gdpl2112.mirai.p1.CallApiPlu gin$1.onMessage(CallApiPlugin.java:51) ... 14 more 2022-12-31 16:54:13 V/Bot.1705609074: [没名字的群就是好群(1061257810)] (209858 1065) -> 星座运势 2022-12-31 16:54:14 V/Bot.1705609074: Group(1061257810) <- 星座运势调用失败
这是我的配置文件
{ "passwd":"123456", "permType":"all", "port":20042, "proxyIp":null, "proxyPort":null, "splitChar":" ", "templates":[ { "out": "<Pic:$1>", "outArgs": [ "pic" ], "touch": "涩图2", "url": "http://iw233.fgimax2.fgnwctvip.com/API/Ghs.php?type=json", "err": "涩图调用失败" }, { "out": "$1", "outArgs": [ "data" ], "touch": "星座运势", "url": "https://api.iyk0.com/xzys/?msg=$1", "err": "星座运势调用失败" }, { "out": "$1:$2\n$3:$4\n$5:$6\n", "outArgs": [ "data.forecast[0].date", "data.forecast[0].type", "data.forecast[1].date", "data.forecast[1].type", "data.forecast[2].date", "data.forecast[2].type" ], "touch": "未来天气", "url": "https://api.vvhan.com/api/weather?city=$1&type=week", "err": "未来天气查询失败" }, { "out": "<Audio:$1>", "outArgs": [ "mp3" ], "touch": "小妲己", "url": "http://api.weijieyue.cn/api/xiaodaji/api.php?msg=$1", "err": "调用失败" }, { "out": "QQ:$1\n评语:$2\n凶吉:$3\n性格:$4", "outArgs": [ "qq", "pingyu", "xiongji", "xingge" ], "touch": "QQ凶吉", "url": "http://api.weijieyue.cn/api/qq/xiongji.php?qq=$qid", "err": "调用失败" } ] }
麻烦大佬了
-
@mantou api 不提供服务了
-
@Kloping 可是那个未来天气的api应该是可以用的啊,在浏览器里打开是会返回天气信息的,但控制台报错好像和这个也一样
这是“未来天气”的报错2023-01-02 15:31:42 V/Bot.1705609074: [没名字的群就是好群(1061257810)] (2098581065) -> 未来天气 北京 2023-01-02 15:31:42 E/Bot.1705609074: java.lang.IllegalStateException: Exception while broadcasting event 'GroupMessageEvent' java.lang.IllegalStateException: Exception while broadcasting event 'GroupMessageEvent' at net.mamoe.mirai.internal.network.components.EventDispatcherImpl.broadcast$suspendImpl(EventDispatcher.kt:104) at net.mamoe.mirai.internal.network.components.EventDispatcherImpl$broadcast$1.invokeSuspend(EventDispatcher.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.UndispatchedCoroutine.afterResume(CoroutineContext.kt:233) at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) 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.IllegalStateException: 未找到异常处理器. 请继承 SimpleListenerHost 中的 handleException 方法, 或在构造 SimpleListenerHost 时提供 CoroutineExceptionHandler ------------ Cannot find exception handler from coroutineContext. Please extend SimpleListenerHost.handleException or provide a CoroutineExceptionHandler to the constructor of SimpleListenerHost at net.mamoe.mirai.event.SimpleListenerHost.handleException(JvmMethodListeners.kt:192) at MiraiCallApiPlugin-v2.8.1.jar//io.github.gdpl2112.mirai.p1.CallApiPlugin$1.handleException(CallApiPlugin.java:46) at net.mamoe.mirai.event.SimpleListenerHost$special$$inlined$CoroutineExceptionHandler$1.handleException(CoroutineExceptionHandler.kt:111) at net.mamoe.mirai.internal.event.SafeListener.onEvent(SafeListener.kt:75) at net.mamoe.mirai.internal.event.SafeListener$onEvent$1.invokeSuspend(SafeListener.kt) ... 9 more Caused by: net.mamoe.mirai.event.ExceptionInEventHandlerException: Exception in EventHandler at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt.registerEventHandler$callMethod$invokeWithErrorReport(JvmMethodListenersInternal.kt:147) at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt.access$registerEventHandler$callMethod$invokeWithErrorReport(JvmMethodListenersInternal.kt:1) at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt$registerEventHandler$callMethod$2.invokeSuspend(JvmMethodListenersInternal.kt:154) 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) ... 4 more Caused by: java.lang.reflect.InvocationTargetException at jdk.internal.reflect.GeneratedMethodAccessor82.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt.registerEventHandler$callMethod$invokeWithErrorReport(JvmMethodListenersInternal.kt:140) ... 10 more Caused by: java.lang.NoClassDefFoundError: Could not initialize class io.github.kloping.clasz.ClassUtils at lib-tts.jar//io.github.kloping.serialize.HMLObject.getFields(HMLObject.java:276) at lib-tts.jar//io.github.kloping.serialize.HMLObject.work(HMLObject.java:81) at lib-tts.jar//io.github.kloping.serialize.HMLObject.toHMLString(HMLObject.java:75) at MiraiCallApiPlugin-v2.8.1.jar//io.github.gdpl2112.mirai.p1.ManagerConf.apply(ManagerConf.java:64) at MiraiCallApiPlugin-v2.8.1.jar//io.github.gdpl2112.mirai.p1.ManagerConf.getStateByTouchAndIdDefault(ManagerConf.java:45) at MiraiCallApiPlugin-v2.8.1.jar//io.github.gdpl2112.mirai.p1.Worker.enable(Worker.java:113) at MiraiCallApiPlugin-v2.8.1.jar//io.github.gdpl2112.mirai.p1.Worker.call(Worker.java:95) at MiraiCallApiPlugin-v2.8.1.jar//io.github.gdpl2112.mirai.p1.CallApiPlugin$1.onMessage0(CallApiPlugin.java:74) at MiraiCallApiPlugin-v2.8.1.jar//io.github.gdpl2112.mirai.p1.CallApiPlugin$1.onMessage(CallApiPlugin.java:51) ... 14 more 2023-01-02 15:32:06 V/Bot.1705609074: [没名字的群就是好群(1061257810)] (2098581065) -> 未来天气 北京 2023-01-02 15:32:07 V/Bot.1705609074: Group(1061257810) <- 未来天气查询失败
实在是想不明白
再次麻烦大佬了!如果需要其他信息尽管说,我可以提供 -
@mantou 你的lib-tss.jar 是哪个版本的
可以用最新的
https://github.com/Kloping/Mirai_Plugins_Auto_Reply/releases/tag/lib-tts.1 -
@Kloping 我就是用的这个版本的
-
@mantou 什么系统
-
@Kloping Windows sever 2012 r2
-
看下这个文件
-
我这好像是个空文件,大小0B
-
https://api.vvhan.com/60s.html 大佬请问这个api接口的配置应该怎么写
-
-
-
@yindeng 控制台输出网址
-
-
@yindeng ? 已经足够详细了,你给日志我给你指出来
-
@Kloping
就是templates配置不会弄,大佬能教我吗