基于 graphql 的 宝可梦查询插件
-
enable和enable all this后也没有提示哎,群主,是我哪里做错了吗,也没有报错
-
@shihuang214 看看详细日志
-
@whiterasbk 遇到一个很奇怪的问题,如果不解压那个zip放进去前,enable和enable this这几个至少还有响应,如果解压后的文件放进去后,就直接没有反应了,且日志中没有记录,需要把log设置成什么级别才能显示
-
@shihuang214 提供详细信息以供复现,或者加qq交流
-
@whiterasbk
只有启动时的日志,之后输入命令不再有任何回应[92m2022-10-04 10:47:43 I/bot.good.QueryPokemon: query pokemon loaded[0m[m [91m2022-10-04 10:47:43 Wderr: Warning: Nashorn engine is planned to be removed from a future JDK release [0m[m [92m2022-10-04 10:47:44 I/bot.good.QueryPokemon: [loaded script: script.js][0m[m [92m2022-10-04 10:47:44 I/bot.good.QueryPokemon: [loaded mapper: egg_group.yml][0m[m [92m2022-10-04 10:47:44 I/bot.good.QueryPokemon: [loaded mapper: public.yml][0m[m [92m2022-10-04 10:47:44 I/bot.good.QueryPokemon: [loaded mapper: stats_abbreviation.yml][0m[m [92m2022-10-04 10:47:45 I/bot.good.QueryPokemon: [loaded mapper script: mapper.js][0m[m [91m2022-10-04 10:47:45 W/bot.good.QueryPokemon: Linked class io.ktor.client.engine.HttpClientEngineFactory in mirai-api-http-v2.4.0.mirai.jar but plugin not depend on it.[0m[m [91m2022-10-04 10:47:45 W/bot.good.QueryPokemon: Class loading logic may change in feature.[0m[m [31m2022-10-04 10:47:45 E/bot.good.QueryPokemon: java.lang.ExceptionInInitializerError java.lang.ExceptionInInitializerError at QueryPokemon-0.0.1.jar//bot.good.QueryPokemon.onEnable(QueryPokemon.kt:59) at net.mamoe.mirai.console.internal.plugin.JvmPluginInternal.internalOnEnable$mirai_console(JvmPluginInternal.kt:131) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.enable(BuiltInJvmPluginLoaderImpl.kt:278) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.enable(BuiltInJvmPluginLoaderImpl.kt:35) at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt) at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt:50) at net.mamoe.mirai.console.plugin.PluginManager.enablePlugin(PluginManager.kt:173) at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.enableAllLoadedPlugins$mirai_console(PluginManagerImpl.kt:178) at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:235) at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:464) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:168) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon$default(MiraiConsoleTerminalLoader.kt:167) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.main(MiraiConsoleTerminalLoader.kt:52) at java.basek.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.basek.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.basek.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.itxtech.mcl.Utility.bootMirai(Utility.java:83) at java.basek.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.basek.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.basek.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138) at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:226) at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1692) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1013) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:412) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3578) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107) at org.mozilla.javascript.ArrowFunction.call(ArrowFunction.java:43) at org.mozilla.javascript.InterfaceAdapter.invokeImpl(InterfaceAdapter.java:155) at org.mozilla.javascript.InterfaceAdapter.lambda$invoke$0(InterfaceAdapter.java:105) at org.mozilla.javascript.Context.call(Context.java:554) at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:522) at org.mozilla.javascript.InterfaceAdapter.invoke(InterfaceAdapter.java:105) at org.mozilla.javascript.jdk18.VMBridge_jdk18$1.invoke(VMBridge_jdk18.java:126) at com.sun.proxy.$Proxy4.run(Unknown Source) at org.itxtech.mcl.script.ScriptManager.phaseBoot(ScriptManager.java:106) at org.itxtech.mcl.Loader.lambda$start$3(Loader.java:176) at org.itxtech.mcl.Loader.tryCatching(Loader.java:145) at org.itxtech.mcl.Loader.start(Loader.java:176) at org.itxtech.mcl.Loader.main(Loader.java:68) Caused by: java.lang.ClassCastException: class io.ktor.client.engine.okhttp.OkHttp cannot be cast to class io.ktor.client.engine.HttpClientEngineFactory (io.ktor.client.engine.okhttp.OkHttp is in unnamed module of loader 'app'; io.ktor.client.engine.HttpClientEngineFactory is in unnamed module of loader 'mirai-api-http-v2.4.0.mirai.jar' @51efb731) at QueryPokemon-0.0.1.jar//bot.good.QueryExecutable.<clinit>(QueryExecutable.kt:162) ... 43 more
-
这个插件有时间限制的么?我的群员测试时bot提示时间限制
-
@anucan 可以设置请求超时
-
@shihuang214 这日志看了一圈也没看出什么特别的,要不咱还是加qq交流吧, 这个我需要复现这个问题, 在你的机器上比较容易找出问题所在
-
@whiterasbk
@shihuang214
宝可梦插件错误的引用了 mirai-api-http 的依赖
可以尝试升级 mirai-api-http
或者重新编译 宝可梦插件 ,使他带上 okhttp依赖(mirai2.jar) -
@cssxsh 准备重开一个, 这个可能要弃坑了(
-
话说必须是Q群管理员吗 机器人的管理员不行吗 -
@第六神觉 是的
-
2022-11-06 23:16:57 E/bot.good.QueryPokemon: accessing url: https://cdn.jsdelivr.net/gh/PokeAPI/sprites@2.0.0/sprites/pokemon/25.png
2022-11-06 23:16:57 E/bot.good.QueryPokemon: java.net.UnknownHostException: 请求的名称有效,但是找不到请求的类型的数据。 (raw.githubusercontent.com)
java.net.UnknownHostException: 请求的名称有效,但是找不到请求的类型的数据。 (raw.githubusercontent.com)
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.base/java.net.InetAddress$PlatformNameService.lookupAllHostAddr(Unknown Source)
at java.base/java.net.InetAddress.getAddressesFromNameService(Unknown Source)
at java.base/java.net.InetAddress$NameServiceAddresses.get(Unknown Source)
at java.base/java.net.InetAddress.getAllByName0(Unknown Source)
at java.base/java.net.InetAddress.getAllByName(Unknown Source)
at java.base/java.net.InetAddress.getAllByName(Unknown Source)
at QueryPokemon-0.0.1.jar//okhttp3.Dns$1.lookup(Dns.java:39)
at QueryPokemon-0.0.1.jar//okhttp3.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:173)
at QueryPokemon-0.0.1.jar//okhttp3.internal.http.RouteSelector.nextProxy(RouteSelector.java:139)
at QueryPokemon-0.0.1.jar//okhttp3.internal.http.RouteSelector.next(RouteSelector.java:81)
at QueryPokemon-0.0.1.jar//okhttp3.internal.http.StreamAllocation.findConnection(StreamAllocation.java:172)
at QueryPokemon-0.0.1.jar//okhttp3.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:123)
at QueryPokemon-0.0.1.jar//okhttp3.internal.http.StreamAllocation.newStream(StreamAllocation.java:93)
at QueryPokemon-0.0.1.jar//okhttp3.internal.http.HttpEngine.connect(HttpEngine.java:296)
at QueryPokemon-0.0.1.jar//okhttp3.internal.http.HttpEngine.sendRequest(HttpEngine.java:248)
at QueryPokemon-0.0.1.jar//okhttp3.RealCall.getResponse(RealCall.java:243)
at QueryPokemon-0.0.1.jar//okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:201)
at QueryPokemon-0.0.1.jar//okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:163)
at QueryPokemon-0.0.1.jar//okhttp3.RealCall.execute(RealCall.java:57)
at QueryPokemon-0.0.1.jar//bot.good.UtilsKt.openStreamOnClient(utils.kt:252)
at QueryPokemon-0.0.1.jar//bot.good.FormatKt.formatMessage(Format.kt:145)
at QueryPokemon-0.0.1.jar//bot.good.FormatKt.formatMessage(Format.kt:238)
at QueryPokemon-0.0.1.jar//bot.good.QueryCommand.query(cmd.kt:263)
at QueryPokemon-0.0.1.jar//bot.good.QueryCommand.access$query(cmd.kt:9)
at QueryPokemon-0.0.1.jar//bot.good.QueryCommand$query$1.invokeSuspend(cmd.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:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
请问这是什么情况啊 -
@Teqine 可能是jsdelivr 的 cdn 不能使用, 试试通过本地图片的方式获取宝可梦图片
-
mirai-console 2.13.0版本在替换解压文件后标红,无法响应:
2022-11-13 20:32:26 E/bot.good.QueryPokemon: java.lang.NoSuchMethodError: 'void io.ktor.client.HttpClientConfig.install$default(io.ktor.client.HttpClientConfig, io.ktor.client.features.HttpClientFeature, kotlin.jvm.functions.Function1, int, java.lang.Object)' java.lang.NoSuchMethodError: 'void io.ktor.client.HttpClientConfig.install$default(io.ktor.client.HttpClientConfig, io.ktor.client.features.HttpClientFeature, kotlin.jvm.functions.Function1, int, java.lang.Object)' at QueryPokemon-0.0.1.jar//bot.good.QueryExecutable$Companion$httpClient$1.invoke(QueryExecutable.kt:163) at QueryPokemon-0.0.1.jar//bot.good.QueryExecutable$Companion$httpClient$1.invoke(QueryExecutable.kt:162) at io.ktor.client.HttpClientKt.HttpClient(HttpClient.kt:40) at QueryPokemon-0.0.1.jar//bot.good.QueryExecutable.<clinit>(QueryExecutable.kt:162) at QueryPokemon-0.0.1.jar//bot.good.QueryPokemon.onEnable(QueryPokemon.kt:59) at net.mamoe.mirai.console.internal.plugin.JvmPluginInternal.internalOnEnable$mirai_console(JvmPluginInternal.kt:131) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.enable(BuiltInJvmPluginLoaderImpl.kt:305) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.enable(BuiltInJvmPluginLoaderImpl.kt:35) at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt) at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt:50) at net.mamoe.mirai.console.plugin.PluginManager.enablePlugin(PluginManager.kt:173) at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.enableAllLoadedPlugins$mirai_console(PluginManagerImpl.kt:175) at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:336) at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:508) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:177) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon$default(MiraiConsoleTerminalLoader.kt:176) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.main(MiraiConsoleTerminalLoader.kt:54) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.itxtech.mcl.Utility.bootJars(Utility.java:86) at org.itxtech.mcl.Utility.bootJars(Utility.java:76) at org.itxtech.mcl.Utility.bootMirai(Utility.java:98) at org.itxtech.mcl.module.builtin.Boot.boot(Boot.java:113) at org.itxtech.mcl.module.ModuleManager.phaseBoot(ModuleManager.java:123) at org.itxtech.mcl.Loader.lambda$start$4(Loader.java:194) at org.itxtech.mcl.Loader.tryCatching(Loader.java:151) at org.itxtech.mcl.Loader.start(Loader.java:194) at org.itxtech.mcl.Loader.main(Loader.java:84)
猜测是版本问题,换成2.12的版本就可以正常运行了,这个是什么情况呢
-
@Reaning
插件没有定义 ktor 依赖
https://github.com/mamoe/mirai/issues/2297 -
@whiterasbk 请问这个要怎么增加依赖呢?
-
-
@whiterasbk 加载这个模块发生报错
2022-11-18 13:08:46 E/main: Failed to init MiraiConsole. net.mamoe.mirai.console.internal.util.ServiceLoadException: Could not load service bot.good.QueryPokemon. at net.mamoe.mirai.console.internal.util.PluginServiceHelper.loadService(PluginServiceHelper.kt:60) at net.mamoe.mirai.console.internal.util.PluginServiceHelper.loadAllServices(PluginServiceHelper.kt:42) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl$extractPlugins$findAllInstances$2.invoke(BuiltInJvmPluginLoaderImpl.kt:197) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl$extractPlugins$findAllInstances$2.invoke(BuiltInJvmPluginLoaderImpl.kt:192) at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:210) at kotlin.sequences.FlatteningSequence$iterator$1.ensureItemIterator(Sequences.kt:314) at kotlin.sequences.FlatteningSequence$iterator$1.hasNext(Sequences.kt:303) at kotlin.sequences.TransformingSequence$iterator$1.hasNext(Sequences.kt:214) at kotlin.sequences.TransformingSequence$iterator$1.hasNext(Sequences.kt:214) at kotlin.sequences.FlatteningSequence$iterator$1.ensureItemIterator(Sequences.kt:307) at kotlin.sequences.FlatteningSequence$iterator$1.hasNext(Sequences.kt:303) at kotlin.sequences.SequencesKt___SequencesKt.toCollection(_Sequences.kt:787) at kotlin.sequences.SequencesKt___SequencesKt.toSet(_Sequences.kt:828) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.extractPlugins(BuiltInJvmPluginLoaderImpl.kt:218) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.listPlugins(BuiltInJvmPluginLoaderImpl.kt:67) at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.listPlugins(JvmPluginLoader.kt) at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.listAndSortAllPlugins(PluginManagerImpl.kt:189) at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.findAndSortAllPluginsUsingBuiltInLoaders(PluginManagerImpl.kt:135) at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.loadAllPluginsUsingBuiltInLoaders$mirai_console(PluginManagerImpl.kt:145) at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:279) at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:508) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:177) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon$default(MiraiConsoleTerminalLoader.kt:176) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.main(MiraiConsoleTerminalLoader.kt:54) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) at java.base/java.lang.reflect.Method.invoke(Method.java:577) at org.itxtech.mcl.Utility.bootJars(Utility.java:86) at org.itxtech.mcl.Utility.bootJars(Utility.java:76) at org.itxtech.mcl.Utility.bootMirai(Utility.java:98) at org.itxtech.mcl.module.builtin.Boot.boot(Boot.java:113) at org.itxtech.mcl.module.ModuleManager.phaseBoot(ModuleManager.java:123) at org.itxtech.mcl.Loader.lambda$start$4(Loader.java:196) at org.itxtech.mcl.Loader.tryCatching(Loader.java:151) at org.itxtech.mcl.Loader.start(Loader.java:196) at org.itxtech.mcl.Loader.main(Loader.java:84) Caused by: java.lang.ExceptionInInitializerError at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:488) at java.base/java.lang.Class.forName(Class.java:467) at net.mamoe.mirai.console.internal.util.PluginServiceHelper.loadService(PluginServiceHelper.kt:51) ... 34 more Caused by: org.eclipse.aether.resolution.DependencyResolutionException: Could not find artifact me.sargunvohra.lib:pokekotlin:jar:2.3.0 in (https://maven.aliyun.com/repository/central) at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:374) at net.mamoe.mirai.console.internal.plugin.JvmPluginDependencyDownloader.resolveDependencies(JvmPluginDependencyDownload.kt:265) at net.mamoe.mirai.console.internal.plugin.JvmPluginClassLoaderN.linkLibraries(JvmPluginClassLoader.kt:338) at net.mamoe.mirai.console.internal.plugin.JvmPluginClassLoaderN.linkPluginPrivateLibraries$mirai_console(JvmPluginClassLoader.kt:308) at net.mamoe.mirai.console.internal.plugin.JvmPluginClassLoaderN.linkPluginLibraries(JvmPluginClassLoader.kt:330) at net.mamoe.mirai.console.internal.plugin.JvmPluginInternal.__jpi_try_to_init_dependencies$mirai_console(JvmPluginInternal.kt:175) at net.mamoe.mirai.console.plugin.jvm.KotlinPlugin.<init>(KotlinPlugin.kt:25) at net.mamoe.mirai.console.plugin.jvm.KotlinPlugin.<init>(KotlinPlugin.kt:20) at QueryPokemon-0.0.1.mirai2.jar//bot.good.QueryPokemon.<init>(QueryPokemon.kt:23) at QueryPokemon-0.0.1.mirai2.jar//bot.good.QueryPokemon.<clinit>(QueryPokemon.kt) ... 38 more Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact me.sargunvohra.lib:pokekotlin:jar:2.3.0 in (https://maven.aliyun.com/repository/central) at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:431) at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:235) at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:357) ... 47 more Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact me.sargunvohra.lib:pokekotlin:jar:2.3.0 in (https://maven.aliyun.com/repository/central) at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:48) at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:369) at org.eclipse.aether.util.concurrency.RunnableErrorForwarder.lambda$wrap$0(RunnableErrorForwarder.java:73) at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:627) at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:262) at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520) at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:408) ... 49 more
-
This post is deleted!