- 是
- Overflow
- 稳定
- mirai插件
- win
AdorableParker 发布的帖子
-
加载插件时提示java.lang.NoSuchMethodError
控制台报错内容
2021-12-16 21:20:22 E/navigatorTB: java.lang.NoSuchMethodError: 'kotlin.reflect.KType kotlin.jvm.internal.Reflection.mutableCollectionType(kotlin.reflect.KType)' java.lang.NoSuchMethodError: 'kotlin.reflect.KType kotlin.jvm.internal.Reflection.mutableCollectionType(kotlin.reflect.KType)' at com.example.navigatorTB_Nymph.MyPluginData.<clinit>(MyPluginData.kt:80) at com.example.navigatorTB_Nymph.PluginMain.onEnable(PluginMain.kt:70) at net.mamoe.mirai.console.internal.plugin.JvmPluginInternal.internalOnEnable$mirai_console(JvmPluginInternal.kt:113) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.enable(BuiltInJvmPluginLoaderImpl.kt:122) at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt) at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt:36) at net.mamoe.mirai.console.plugin.PluginManager.enablePlugin(PluginManager.kt:129) at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.enableAllLoadedPlugins$mirai_console(PluginManagerImpl.kt:172) at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:214) at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:276) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:152) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon$default(MiraiConsoleTerminalLoader.kt:151) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.main(MiraiConsoleTerminalLoader.kt:47) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.itxtech.mcl.Utility.bootMirai(Utility.java:83) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) 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)
报错中提示的相关插件代码内容
object PluginMain : KotlinPlugin( JvmPluginDescription(...) ) { override fun onEnable() { MySetting.reload() MyPluginData.reload() //(PluginMain.kt:70) UsageStatistics.reload() // TODO } // MyPluginData文件没有第80行...
-
RE: PluginVoodoo项目的塔罗牌图片替换
@xs26
就是应该在控制台里面输入这段perm add u* org.alerhughes.plugin-voodoo:command.塔罗牌 // 表示所有人都可以执行,前提是你安装了 chat-command 插件
-
RE: PluginVoodoo项目的塔罗牌图片替换
根据我的bot的经验,只需要随机值确定为每人每天只会有一个唯一结果,用户自然而然的就会自己控制调用次数(还能解决逆反心理,指某些用户每天就得把配额刷完才甘心
-
RE: forwardMessage的使用
@karlatemp 因为错误被runCatching捕获了,it.message输出的内容就是发送文件过大。。
问题已经解决了,排查出来的信息,能知道就是使用bot.asFriend作为构建的forwardMessage的发送者,然后将这个forwardMessage发送出去就会有问题 -
forwardMessage的使用
为什么我同样的构造一个forwardMessage
在命令里面单发就能成功发送
自动推送里面群发就会报文件过大的错误// 这个代码块怎么不支持kotlin语法标注 // 自动推送的代码块 val bot = Bot.getInstance(MySetting.BotID) val forwardMessage = dynamic.getMessage(bot.asFriend, bot, time) for (groupInfo in groupList) { val groupID = groupInfo["group_id"] as Int val group = bot.getGroup(groupID.toLong()) if (group != null && group.botMuteRemaining <= 0) { runCatching { group.sendMessage(forwardMessage) }.onFailure { logger.warning { "${it.message}" } } } }
// 构造forwardMessage的部分 data class Dynamic(val timestamp: Long, val text: String?, val imageStream: List<InputStream>?) { suspend fun getMessage(subject: Contact, uORb: UserOrBot, t:String): ForwardMessage = buildForwardMessage(subject) { uORb says PlainText("$text") imageStream?.forEach { uORb says it.uploadAsImage(subject) } uORb says PlainText("发布时间:$t") } }