非常感谢楼主科普。目前我没有在开发界面找到群聊相关的功能,不过就算能加群,也似乎只能监听到at机器人的消息,这点实在有点尴尬,还是打算mirai不能用了再想办法。另外请问公域和私域的区别是什么?(官方文档甚至要申请通过了才能看x)
F
frankcwl 发布的帖子
-
RE: 腾讯官方Bot接口扫盲
-
RE: 简单的Rss订阅插件 已添加RssHub支持 番剧订阅Bt种子自动上传
频繁出现如下错误,虽然不影响插件正常工作,但占用了日志大量空间,经观察不是来源于自建rsshub的链接都会报这个错
2023-09-29 00:02:04 W/rss-helper: Rss: https://yuc.wiki/atom.xml java.net.UnknownHostException: yuc.wiki and CNAME[] at rss-helper-1.4.0.mirai2.jar//io.github.gnuf0rce.rss.HttpClientKt$Dns$1.lookup(HttpClient.kt:119) at rss-helper-1.4.0.mirai2.jar[private]//okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(RouteSelector.kt:164) at rss-helper-1.4.0.mirai2.jar[private]//okhttp3.internal.connection.RouteSelector.nextProxy(RouteSelector.kt:129) at rss-helper-1.4.0.mirai2.jar[private]//okhttp3.internal.connection.RouteSelector.next(RouteSelector.kt:71) at rss-helper-1.4.0.mirai2.jar[private]//okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:205) at rss-helper-1.4.0.mirai2.jar[private]//okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106) at rss-helper-1.4.0.mirai2.jar[private]//okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74) at rss-helper-1.4.0.mirai2.jar[private]//okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255) at rss-helper-1.4.0.mirai2.jar[private]//okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32) at rss-helper-1.4.0.mirai2.jar[private]//okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at rss-helper-1.4.0.mirai2.jar[private]//okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95) at rss-helper-1.4.0.mirai2.jar[private]//okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at rss-helper-1.4.0.mirai2.jar[private]//okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83) at rss-helper-1.4.0.mirai2.jar[private]//okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at rss-helper-1.4.0.mirai2.jar[private]//okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76) at rss-helper-1.4.0.mirai2.jar[private]//okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at rss-helper-1.4.0.mirai2.jar[private]//okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201) at rss-helper-1.4.0.mirai2.jar[private]//okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:517) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833)
-
RE: 简单的Rss订阅插件 已添加RssHub支持 番剧订阅Bt种子自动上传
请问每次rss有新消息到bot发出消息有一定延迟是什么原因(之前以为是rsshub的原因,但禁止了rsshub的缓存之后还是有延迟)
-
RE: dependencies中加入org.apache.httpcomponents:httpclient后运行报错
@Karlatemp 因为插件使用java写的,我觉得在kotlin环境下运行可能得到的结果不一样,所以我尝试在java中加入了以下代码
public void onEnable() { try { dump(Class.forName("org.apache.http.client.methods.HttpUriRequest")); dump(Majsoul.class.getClassLoader().loadClass("org.apache.http.client.methods.HttpUriRequest")); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } void dump(Class<?> c) { System.out.println(c); System.out.println("|- CCL " + c.getClassLoader()); }
得到的结果是
2022-11-17 10:48:42 I/stdout: interface org.apache.http.client.methods.HttpUriRequest 2022-11-17 10:48:42 I/stdout: |- CCL sun.misc.Launcher$AppClassLoader@55f96302 2022-11-17 10:48:42 I/stdout: interface org.apache.http.client.methods.HttpUriRequest 2022-11-17 10:48:42 I/stdout: |- CCL DynLibClassLoader{IndependentCL{majsoul-dev.mirai2.jar}}
-
RE: dependencies中加入org.apache.httpcomponents:httpclient后运行报错
2022-11-17 10:22:04 I/stdout: interface org.apache.http.client.methods.HttpUriRequest 2022-11-17 10:22:04 I/stdout: |- CCL DynLibClassLoader{IndependentCL{majsoul-dev.mirai2.jar}} 2022-11-17 10:22:04 I/stdout: interface org.apache.http.client.methods.HttpUriRequest 2022-11-17 10:22:04 I/stdout: |- CCL DynLibClassLoader{IndependentCL{majsoul-dev.mirai2.jar}}
-
dependencies中加入org.apache.httpcomponents:httpclient后运行报错
java初学者,想试着开发插件玩一下,遇到了以下问题。
在build.gradle.kts中的dependencies加入了implementation("org.apache.httpcomponents:httpclient:4.5.13")
能顺利通过编译,但是程序每次执行到HttpClients.createDefault()方法时,就会有该报错
java.lang.LinkageError: loader constraint violation: when resolving method "org.apache.http.impl.client.CloseableHttpClient.execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/client/methods/CloseableHttpResponse;" the class loader (instance of net/mamoe/mirai/console/internal/plugin/JvmPluginClassLoaderN) of the current class, com/frankcwl/Majsoul, and the class loader (instance of net/mamoe/mirai/console/internal/plugin/DynLibClassLoader) for the method's defining class, org/apache/http/impl/client/CloseableHttpClient, have different Class objects for the type org/apache/http/client/methods/HttpUriRequest used in the signature
可能是因为引入的包和mirai依赖的冲突了,但是如果不在dependencies中添加的话,编译时就会报错Cannot resolve symbol 'HttpClients'
本人之前没有接触过gradle,请问该怎么修改