mamoe / mirai-console Goto Github PK
View Code? Open in Web Editor NEWmirai 的高效率 QQ 机器人控制台
License: GNU Affero General Public License v3.0
mirai 的高效率 QQ 机器人控制台
License: GNU Affero General Public License v3.0
是否可以考虑支持在无终端环境下运行,例如nohub或docker环境。
命令可以考虑使用参数传入
好处:
/app # nohup java -jar mirai-console-wrapper-0.2.0-all.jar
nohup: appending output to nohup.out
/app # cat nohup.out
You are running Mirai-Console-Wrapper under /app
Please select Console Type
请选择 Console 版本
=> Pure : pure console
=> Graphical : graphical UI except unix
=> Terminal : [Not Supported Yet] console in unix
Exception in thread "main" java.util.NoSuchElementException
at java.base/java.util.Scanner.throwFor(Scanner.java:937)
at java.base/java.util.Scanner.next(Scanner.java:1478)
at net.mamoe.mirai.console.wrapper.WrapperMain.preStartInNonNative(WrapperMain.kt:107)
at net.mamoe.mirai.console.wrapper.WrapperMain.main(WrapperMain.kt:89)
/app # ps aux
PID USER TIME COMMAND
1 root 0:00 /bin/sh
29 root 0:00 ps aux
/app #
/app # nohup java -jar mirai-console-wrapper-0.2.0-all.jar
nohup: appending output to nohup.out
/app # cat nohup.out
You are running Mirai-Console-Wrapper under /app
Starting Mirai Console Pure, reset by clear /content/
Starting version check...
Fetching Newest Core Version ..
Fetching Newest Console Version of Pure
Local Core Version: 0.36.1 | Newest Core Version: 0.36.1
Local Console-Pure Version: 0.4.8 | Newest Console-Pure Version: 0.4.8
Version check complete, starting Mirai
shadow-Protocol:/app/content/mirai-core-qqandroid-jvm-0.36.1.jar
Console :/app/content/mirai-console-0.4.8.jar
Root :/app/
07:07:01 [INFO] [Mirai 0.4.8 Pkmon] Mirai-console now running under /app
07:07:01 [INFO] [Mirai 0.4.8 Pkmon] Get news in github: https://github.com/mamoe/mirai
07:07:01 [INFO] [Mirai 0.4.8 Pkmon] Mirai为开源项目,请自觉遵守开源项目协议
07:07:01 [INFO] [Mirai 0.4.8 Pkmon] Powered by Mamoe Technologies and contributors
07:07:01 [INFO] [Plugin Manager] 开始加载/app/plugins/下的插件
07:07:01 [INFO] [Plugin Manager] 加载了0个插件
07:07:01 [INFO] [Mirai 0.4.8 Pkmon] Mirai-console 启动完成
07:07:01 [INFO] [Mirai 0.4.8 Pkmon] "/login qqnumber qqpassword " to login a bot
07:07:01 [INFO] [Mirai 0.4.8 Pkmon] "/login qq号 qq密码 " 来登录一个BOT
/app # ps aux
PID USER TIME COMMAND
1 root 0:00 /bin/sh
163 root 0:00 ps aux
/app #
对于以下情况:
val groups: List<Long> by config
每次调用 groups 都会从 config 中重新读取 List 然后进行类型转换,性能很低
在登录一段时间后便出现了
[NETWORK]: Cannot do fast relogin. Trying slow relogin
[NETWORK]: Connected to server 113. 96.13.208: 8080
ps:用的阿里家server登录的
本人想在安卓手机上运行Mirai-Console-Pure
但由于Termux不支持jre所以不知道该怎么办(学习python的萌新)
而Mirai-Console-Android也不知道何时能够发布
所以就想问一下现阶段怎么在安卓手机上运行Mirai程序
While I do love a new version, it is really unnecessary to update automatically (and forced), it is better to remind the user during startup and limit the timeout, but not to do it itself. And, when there is an error during auto-update like Failed to fetch newest version
, it affects the the following running.
As the title.
目前版本的mirai-console个人体验而言已经相对稳定了,希望能有一个能关闭启动时自动更新的办法来锁定版本,为Docker化和部署做准备。
利用Docker运行时,汉字全部显示为问号。
Dockerfile
:
FROM ubuntu:bionic
WORKDIR /mirai
RUN apt-get upgrade -y && apt-get update -y
RUN apt install apt-transport-https ca-certificates -y
COPY sources.list /etc/apt/sources.list
RUN apt-get update -y
RUN apt-get install default-jre default-jdk -y
ENTRYPOINT java -jar ./mirai-console-wrapper.jar
在Dockerfile
同一文件夹下有sources.list
(用于使用清华TUNA镜像安装jre,jdk等):
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
在Dockerfile
同一文件夹下有文件夹mirai/
,内部有名为mirai-console-wrapper.jar
的0.3.0版本的mirai console。
Docker编译命令:
docker build --rm -f "Dockerfile" -t mirai:latest "."
Docker运行命令:
docker run --interactive -v $(pwd)/mirai:/mirai -w /mirai mirai:latest
输出节选:
09:11:55 [INFO] [Mirai 0.4.9 Pkmon] Mirai-console now running under /mirai
09:11:55 [INFO] [Mirai 0.4.9 Pkmon] Get news in github: https://github.com/mamoe/mirai
09:11:55 [INFO] [Mirai 0.4.9 Pkmon] Mirai?????????????????
09:11:55 [INFO] [Mirai 0.4.9 Pkmon] Powered by Mamoe Technologies and contributors
09:11:55 [INFO] [Plugin Manager] ????/mirai/plugins/????
09:11:55 [INFO] [Plugin Manager] ???0???
09:11:55 [INFO] [Mirai 0.4.9 Pkmon] Mirai-console ????
09:11:55 [INFO] [Mirai 0.4.9 Pkmon] "/login qqnumber qqpassword " to login a bot
09:11:55 [INFO] [Mirai 0.4.9 Pkmon] "/login qq? qq?? " ?????BOT
help
09:12:12 [INFO] [Command]
-> manager :Add a manager
-> login :?????
-> status :????
-> say :??????
-> plugins :??????
-> command :??????
-> about :About Mirai-Console
-> reload :????????
-> install :Install plugin from PluginCenter
更改终端本身的编码不起作用。
希望能暂时先提供一个选项,能使输出是全英文。
昨天还好好的!还是可以成功登录的,就是脚本没法跑了😟
报错如下两部分:
[NETWORK ERROR]:net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler$TimeoutException: timeout receiving response of friendlist.getFriendGroupList
net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler$TimeoutException: timeout receiving response of friendlist.getFriendGroupList
at net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler$sendAndExpect$6.invokeSuspend(QQAndroidBotNetworkHandler.kt:600)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
Suppressed: net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler$TimeoutException: timeout receiving response of friendlist.getFriendGroupList
... 7 more
Suppressed: net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler$TimeoutException: timeout receiving response of friendlist.getFriendGroupList
... 7 more
[NETWORK ERROR]: java.lang.IllegalStateException: type mismatch. Expected 10, actual 0
java.lang.IllegalStateException: type mismatch. Expected 10, actual 0
at net.mamoe.mirai.qqandroid.io.serialization.jce.CommonKt.checkType-lytu1pA(common.kt:61)
at net.mamoe.mirai.qqandroid.io.serialization.jce.JceDecoder.beginStructure(JceDecoder.kt:213)
at net.mamoe.mirai.qqandroid.io.serialization.jce.JceDecoder$ListReaderImpl.beginStructure(JceDecoder.kt:90)
at net.mamoe.mirai.qqandroid.network.protocol.data.jce.FriendInfo$$serializer.deserialize(FriendList.kt)
at net.mamoe.mirai.qqandroid.network.protocol.data.jce.FriendInfo$$serializer.deserialize(FriendList.kt:97)
at kotlinx.serialization.Decoder$DefaultImpls.decodeSerializableValue(Decoding.kt:225)
at kotlinx.serialization.builtins.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:16)
at kotlinx.serialization.builtins.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:63)
at kotlinx.serialization.internal.ListLikeSerializer.readElement(CollectionSerializers.kt:87)
at kotlinx.serialization.internal.ListLikeSerializer.readAll(CollectionSerializers.kt:83)
at kotlinx.serialization.internal.AbstractCollectionSerializer.patch(CollectionSerializers.kt:31)
at kotlinx.serialization.internal.AbstractCollectionSerializer.deserialize(CollectionSerializers.kt:45)
at kotlinx.serialization.Decoder$DefaultImpls.decodeSerializableValue(Decoding.kt:225)
at kotlinx.serialization.internal.TaggedDecoder.decodeSerializableValue(Tagged.kt:153)
at kotlinx.serialization.Decoder$DefaultImpls.decodeNullableSerializableValue(Decoding.kt:231)
at kotlinx.serialization.internal.TaggedDecoder.decodeNullableSerializableValue(Tagged.kt:153)
at kotlinx.serialization.internal.TaggedDecoder$decodeNullableSerializableElement$1.invoke(Tagged.kt:233)
at kotlinx.serialization.internal.TaggedDecoder.tagBlock(Tagged.kt:243)
at kotlinx.serialization.internal.TaggedDecoder.decodeNullableSerializableElement(Tagged.kt:233)
at net.mamoe.mirai.qqandroid.network.protocol.data.jce.GetFriendListResp$$serializer.deserialize(FriendList.kt)
at net.mamoe.mirai.qqandroid.network.protocol.data.jce.GetFriendListResp$$serializer.deserialize(FriendList.kt:60)
at kotlinx.serialization.Decoder$DefaultImpls.decodeSerializableValue(Decoding.kt:225)
at kotlinx.serialization.internal.TaggedDecoder.decodeSerializableValue(Tagged.kt:153)
at net.mamoe.mirai.qqandroid.io.serialization.jce.Jce.load(JceNew.kt:38)
at net.mamoe.mirai.qqandroid.io.serialization.SerializationUtils__UtilsKt.readJceStruct(utils.kt:52)
at net.mamoe.mirai.qqandroid.io.serialization.SerializationUtils.readJceStruct(utils.kt:1)
at net.mamoe.mirai.qqandroid.io.serialization.SerializationUtils__UtilsKt.readJceStruct$default(utils.kt:49)
at net.mamoe.mirai.qqandroid.io.serialization.SerializationUtils.readJceStruct$default(utils.kt:1)
at net.mamoe.mirai.qqandroid.io.serialization.SerializationUtils__UtilsKt$decodeUniPacket$1.invoke(utils.kt:62)
at net.mamoe.mirai.qqandroid.io.serialization.SerializationUtils__UtilsKt$decodeUniPacket$1.invoke(utils.kt)
at net.mamoe.mirai.qqandroid.io.serialization.SerializationUtils__UtilsKt.decodeUniRequestPacketAndDeserialize(utils.kt:86)
at net.mamoe.mirai.qqandroid.io.serialization.SerializationUtils.decodeUniRequestPacketAndDeserialize(utils.kt:1)
at net.mamoe.mirai.qqandroid.io.serialization.SerializationUtils__UtilsKt.decodeUniPacket(utils.kt:59)
at net.mamoe.mirai.qqandroid.io.serialization.SerializationUtils.decodeUniPacket(utils.kt:1)
at net.mamoe.mirai.qqandroid.io.serialization.SerializationUtils__UtilsKt.decodeUniPacket$default(utils.kt:58)
at net.mamoe.mirai.qqandroid.io.serialization.SerializationUtils.decodeUniPacket$default(utils.kt:1)
at net.mamoe.mirai.qqandroid.network.protocol.packet.list.FriendList$GetFriendGroupList.decode(FriendList.kt:137)
at net.mamoe.mirai.qqandroid.network.protocol.packet.KnownPacketFactories.handleIncomingPacket$mirai_core_qqandroid(PacketFactory.kt:488)
at net.mamoe.mirai.qqandroid.network.protocol.packet.KnownPacketFactories.parseIncomingPacket(PacketFactory.kt:231)
at net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler.generifiedParsePacket(QQAndroidBotNetworkHandler.kt:409)
at net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler.parsePacket(QQAndroidBotNetworkHandler.kt:404)
at net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler$parsePacketAsync$1.invokeSuspend(QQAndroidBotNetworkHandler.kt:389)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
否则将会产生空字符串参数
这几天试了一下mirai 不幸的是直接冻结了
解封之后
Received: Error(title=禁止登录, message=当前上网环境异常,请更换网络环境或在常用设备上登录或
稍后再试。, errorInfo=)
Received: Error(title=禁止登录, message=你的帐号因为存在安全风险,已进入安全保护状态,暂时不
能登录。, errorInfo=)
这样下去确实挺麻烦的
在Graphic
中登录一个bot,不论是否登录成功,关闭窗口时调用Console
的close
方法无法完全退出Console
的协程。
OS: macOS 10.15.4
Core: 0.32.0
Graphical: 0.0.5
When using Java 8, window did not pop up and gave following output in terminal:
Version check complete, starting Mirai
shadow-Protocol:/Users/45gfg9/Downloads/mirai/content/mirai-core-qqandroid-jvm-0.32.0.jar
Console :/Users/45gfg9/Downloads/mirai/content/mirai-console-graphical-0.0.5.jar
Root :/Users/45gfg9/Downloads/mirai/
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.mamoe.mirai.console.wrapper.WrapperMain.start(WrapperMain.kt:156)
at net.mamoe.mirai.console.wrapper.WrapperMain.preStartInNonNative(WrapperMain.kt:133)
at net.mamoe.mirai.console.wrapper.WrapperMain.main(WrapperMain.kt:89)
Caused by: java.lang.UnsupportedClassVersionError: javafx/application/Application has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at net.mamoe.mirai.console.graphical.MiraiConsoleGraphicalLoader$Companion.load(MiraiConsoleGraphicalLoader.kt:36)
at net.mamoe.mirai.console.graphical.MiraiConsoleGraphicalLoader.load(MiraiConsoleGraphicalLoader.kt)
... 7 more
Yes, it's problem with Java version being too low (Caused by: java.lang.UnsupportedClassVersionError: javafx/application/Application has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
When using Java 13 / 14, window does pop up, but with NPE trace:
java.lang.NullPointerException
at com.jfoenix.skins.JFXTextFieldSkin.updateTextPos(JFXTextFieldSkin.java:109)
at com.jfoenix.skins.JFXTextFieldSkin.layoutChildren(JFXTextFieldSkin.java:93)
at javafx.scene.control.Control.layoutChildren(Control.java:601)
at javafx.scene.Parent.layout(Parent.java:1206)
at javafx.scene.Parent.layout(Parent.java:1213)
at javafx.scene.Parent.layout(Parent.java:1213)
at javafx.scene.Parent.layout(Parent.java:1213)
at javafx.scene.Parent.layout(Parent.java:1213)
at javafx.scene.Parent.layout(Parent.java:1213)
at javafx.scene.Parent.layout(Parent.java:1213)
at javafx.scene.Parent.layout(Parent.java:1213)
at javafx.scene.Parent.layout(Parent.java:1213)
at javafx.scene.Parent.layout(Parent.java:1213)
at javafx.scene.Parent.layout(Parent.java:1213)
at javafx.scene.Scene.doLayoutPass(Scene.java:576)
at javafx.scene.Scene.preferredSize(Scene.java:1748)
at javafx.scene.Scene$2.preferredSize(Scene.java:393)
at com.sun.javafx.scene.SceneHelper.preferredSize(SceneHelper.java:66)
at javafx.stage.Window$12.invalidated(Window.java:1086)
at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
at javafx.stage.Window.setShowing(Window.java:1174)
at javafx.stage.Window.show(Window.java:1189)
at javafx.stage.Stage.show(Stage.java:273)
at tornadofx.App.start(App.kt:101)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
我用这个指令来获得完整的错误追踪:
java -Djavafx.verbose=true -Dprism.verbose=true -jar mirai-console-wrapper-0.3.0.jar
然后得到了这些报错:
You are running Mirai-Console-Wrapper under C:\Users\Feng\Desktop\mirai-gui
Starting Mirai Console Graphical, reset by clear /content/
Starting version check...
Fetching Newest Core Version ..
Fetching Newest Console Version of Graphical
Local Core Version: 0.37.3 | Newest Core Version: 0.37.3
Local Console-Graphical Version: 0.0.7 | Newest Console-Graphical Version: 0.0.7
Version check complete, starting Mirai
shadow-Protocol:C:\Users\Feng\Desktop\mirai-gui\content\mirai-core-qqandroid-jvm-0.37.3.jar
Console :C:\Users\Feng\Desktop\mirai-gui\content\mirai-console-graphical-0.0.7.jar
Root :C:\Users\Feng\Desktop\mirai-gui/
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-console-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-console-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-datetime-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-datetime-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-debug-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-debug-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-errorhandling-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-errorhandling-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-file-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-file-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-file-l1-2-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-file-l1-2-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-file-l2-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-file-l2-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-handle-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-handle-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-heap-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-heap-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-interlocked-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-interlocked-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-libraryloader-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-libraryloader-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-localization-l1-2-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-localization-l1-2-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-memory-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-memory-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-namedpipe-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-namedpipe-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-processenvironment-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-processenvironment-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-processthreads-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-processthreads-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-processthreads-l1-1-1.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-processthreads-l1-1-1.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-profile-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-profile-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-rtlsupport-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-rtlsupport-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-string-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-string-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-synch-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-synch-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-synch-l1-2-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-synch-l1-2-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-sysinfo-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-sysinfo-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-timezone-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-timezone-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-core-util-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-core-util-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-crt-conio-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-crt-conio-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-crt-convert-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-crt-convert-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-crt-environment-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-crt-environment-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-crt-filesystem-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-crt-filesystem-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-crt-heap-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-crt-heap-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-crt-locale-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-crt-locale-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-crt-math-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-crt-math-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-crt-multibyte-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-crt-multibyte-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-crt-private-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-crt-private-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-crt-process-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-crt-process-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-crt-runtime-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-crt-runtime-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-crt-stdio-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-crt-stdio-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-crt-string-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-crt-string-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-crt-time-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-crt-time-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\api-ms-win-crt-utility-l1-1-0.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\api-ms-win-crt-utility-l1-1-0.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\ucrtbase.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\ucrtbase.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\vcruntime140.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\vcruntime140.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\msvcp140.dll
Loaded C:\Program Files\Java\jdk-13.0.2\bin\msvcp140.dll from java.library.path
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\concrt140.dll
Loaded C:\WINDOWS\system32\concrt140.dll from java.library.path
Prism pipeline init order: d3d sw
Using Double Precision Marlin Rasterizer
Using dirty region optimizations
Not using texture mask for primitives
Not forcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.d3d.D3DPipeline
GraphicsPipeline.createPipeline failed for com.sun.prism.d3d.D3DPipeline
java.lang.ClassNotFoundException: com.sun.prism.d3d.D3DPipeline
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:436)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:333)
at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
at java.base/java.lang.Thread.run(Thread.java:830)
*** Fallback to Prism SW pipeline
Prism pipeline name = com.sun.prism.sw.SWPipeline
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Feng\Desktop\mirai-gui\bin\prism_sw.dll
GraphicsPipeline.createPipeline failed for com.sun.prism.sw.SWPipeline
java.lang.UnsatisfiedLinkError: no prism_sw in java.library.path: [C:\Program Files\Java\jdk-13.0.2\bin, C:\WINDOWS\Sun\Java\bin, C:\WINDOWS\system32, C:\WINDOWS, E:\OracleDB\bin, C:\Windows\system32, C:\Windows, C:\Windows\System32\Wbem, C:\Windows\System32\WindowsPowerShell\v1.0\, C:\Windows\System32\OpenSSH\, C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR, C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common, C:\Program Files\PuTTY\, C:\Program Files\apache-maven-3.6.3\bin, C:\Program Files\Git\cmd, C:\Program Files\ffmpeg\bin, C:\Program Files (x86)\rtmpdump, C:\Program Files\TortoiseSVN\bin, C:\Program Files\Java\jdk-13.0.2\bin, C:\Program Files\Java\jdk1.8.0_241\bin, C:\Program Files (x86)\Common Files\Oracle\Java\javapath, C:\Program Files (x86)\PixivUtil2, C:\MinGW\bin, C:\Program Files\youtube-dl, C:\WINDOWS\system32, C:\WINDOWS, C:\WINDOWS\System32\Wbem, C:\WINDOWS\System32\WindowsPowerShell\v1.0\, C:\WINDOWS\System32\OpenSSH\, C:\Program Files\dotnet\, C:\Program Files\MongoDB\Server\4.2\bin, C:\Program Files\Gradle\bin, C:\Users\Feng\AppData\Local\Microsoft\WindowsApps, C:\Program Files\JetBrains\IntelliJ IDEA 2020.1\bin, C:\Users\Feng\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\Scripts, C:\Users\Feng\.dotnet\tools, C:\Program Files\JetBrains\IntelliJ IDEA 2020.1\bin, ., ., .]
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2670)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:806)
at java.base/java.lang.System.loadLibrary(System.java:1909)
at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:163)
at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:53)
at com.sun.prism.sw.SWPipeline.lambda$static$0(SWPipeline.java:42)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
at com.sun.prism.sw.SWPipeline.<clinit>(SWPipeline.java:41)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:333)
at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
at java.base/java.lang.Thread.run(Thread.java:830)
Graphics Device initialization failed for : d3d, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:244)
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:830)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
... 1 more
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at net.mamoe.mirai.console.wrapper.WrapperMain.start(WrapperMain.kt:157)
at net.mamoe.mirai.console.wrapper.WrapperMain.preStartInNonNative(WrapperMain.kt:134)
at net.mamoe.mirai.console.wrapper.WrapperMain.main(WrapperMain.kt:90)
Caused by: java.lang.RuntimeException: No toolkit found
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:830)
没有安装插件,使用的是AdoptOpenJDK-openjdk8-OpenJ9,运行wrapper闪退。
You are running Mirai-Console-Wrapper under D:\Program\test
Starting Mirai Console Pure, reset by clear /content/
Starting version check...
Fetching Newest Core Version ..
Fetching Newest Console Version of Pure
Local Console-Pure Version: 0.4.6 | Newest Console-Pure Version: 0.4.6
Local Core Version: 0.34.0 | Newest Core Version: 0.34.0
Version check complete, starting Mirai
shadow-Protocol:D:\Program\test\content\mirai-core-qqandroid-jvm-0.34.0.jar
Console :D:\Program\test\content\mirai-console-0.4.6.jar
Root :D:\Program\test/
Exception in thread "Thread-9" java.lang.IllegalArgumentException: Encodings with multiple chars per byte are not supported
at kotlin.io.ConsoleKt.readLine(Console.kt:156)
at kotlin.io.ConsoleKt.readLine(Console.kt:153)
at net.mamoe.mirai.console.pure.MiraiConsoleUIPure$1.invoke(MiraiConsoleUIPure.kt:48)
at net.mamoe.mirai.console.pure.MiraiConsoleUIPure$1.invoke(MiraiConsoleUIPure.kt:25)
at kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:30)
09:30:28 [INFO] [Mirai 0.4.6 Pkmon] Mirai-console now running under D:\Program\test
09:30:28 [INFO] [Mirai 0.4.6 Pkmon] Get news in github: https://github.com/mamoe/mirai
09:30:28 [INFO] [Mirai 0.4.6 Pkmon] Mirai为开源项目,请自觉遵守开源项目协议
09:30:28 [INFO] [Mirai 0.4.6 Pkmon] Powered by Mamoe Technologies and contributors
09:30:28 [INFO] [Plugin Manager] 开始加载D:\Program\test/plugins/下的插件
09:30:28 [INFO] [Plugin Manager] 加载了0个插件
09:30:28 [INFO] [Mirai 0.4.6 Pkmon] Mirai-console 启动完成
09:30:28 [INFO] [Mirai 0.4.6 Pkmon] "/login qqnumber qqpassword " to login a bot
09:30:28 [INFO] [Mirai 0.4.6 Pkmon] "/login qq号 qq密码 " 来登录一个BOT
上述日志打完程序直接自动结束。
该问题在jdk11下不存在。
建议采用单一配置文件,这样插件之间更方便相互获取配置文件
MiraiApiHttp:
port: 8080
authKey: 1234567890
cacheSize: 4096
enableWebsocket: false
cors:
- '*'
MiraiAdminClient:
account: 775150
domain: localhost
identifier: 775150-default
heartBeat: 15000
OtherPlugin:
foo: bar
如果觉得可以,我等下pr
[NETWORK ERROR]: java.lang.IllegalStateException: group is null while a member is joining to
java.lang.IllegalStateException: group is null while a member is joining to
at net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive.MessageSvc$PbGetMsg.decode(MessageSvc.kt:194) at net.mamoe.mirai.qqandroid.network.protocol.packet.KnownPacketFactories.handleIncomingPacket$mirai_core_qqandroid(PacketFactory.kt:474)
at net.mamoe.mirai.qqandroid.network.protocol.packet.KnownPacketFactories.parseIncomingPacket(PacketFactory.kt:221)
at net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler.generifiedParsePacket(QQAndroidBotNetworkHandler.kt:376)
at net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler.parsePacket(QQAndroidBotNetworkHandler.kt:371) at net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler$parsePacketAsync$1.invokeSuspend(QQAndroidBotNetworkHandler.kt:360)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:561)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:727)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:667)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:655)
当我尝试编译最新版的mirai-console-terminal时IDEA向我警告Task 'wrapper' not found in project ### ':mirai-console-terminal'.,原谅我对kotlin和Gradle不太了解,请问这个怎么解决(开发者可以发一个打包好的版本吗)自己下kotlin编译器下载了一个G的依赖后告诉我报错,心态都崩了啊T T
class 配置(val config: Config) {
class AccountSettings : 子配置() {
class UsernameSettings : 子配置() {
val u1: String by delegate
val u2: String by delegate
}
val username: UsernameSettings by delegate
val password: String by delegate
}
@Description("用户设置")
var account: AccountSettings by config
@Description("间隔时间")
val interval: Int by config
}
能否考虑以增加配置文件或命令行参数的方式来实现让mirai-console启动时自动登录账号的功能?
OS: macOS 10.15.4
mirai-core: 0.34.0
mirai-console-wrapper: 0.2.0
mirai-console-pure: 0.4.6
当前CLI的stdin
和stdout
是混在一起的,导致正在输入指令时若接收消息就会将前部分输入带上去
在后台使用/say
发送消息时消息不支持空格 用单/双引号括住也不行
无法用↑↓键跳转输入历史(按键会转成类似^[[A
字符序列,Linux未测试,不知道是不是macOS / iTerm2特性)
无法用←→修正当前指令(同上)
中文字符需要两次Backspace删除
空输入(只按return)会解析未知指令
当想完全放弃当前输入时很容易习惯性按^C
,然而会直接终止mirai-console
日志如下
$ java -Xmx512M -jar mirai-console-wrapper-0.2.0-all.jar
You are running Mirai-Console-Wrapper under /home/app/qqbot
Starting Mirai Console Pure, reset by clear /content/
Starting version check...
Fetching Newest Core Version ..
Fetching Newest Console Version of Pure
Local Console-Pure Version: 0.4.2 | Newest Console-Pure Version: 0.4.2
Local Core Version: 0.32.0 | Newest Core Version: 0.32.0
Version check complete, starting Mirai
shadow-Protocol:/home/app/qqbot/content/mirai-core-qqandroid-jvm-0.32.0.jar
Console :/home/app/qqbot/content/mirai-console-0.4.2.jar
Root :/home/app/qqbot/
10:04:11 [INFO] [Mirai 0.4.2 Pkmon] Mirai-console now running under /home/app/qqbot
10:04:11 [INFO] [Mirai 0.4.2 Pkmon] Get news in github: https://github.com/mamoe/mirai
10:04:11 [INFO] [Mirai 0.4.2 Pkmon] Mirai为开源项目,请自觉遵守开源项目协议
10:04:11 [INFO] [Mirai 0.4.2 Pkmon] Powered by Mamoe Technologies and contributors
10:04:11 [INFO] [Plugin Manager] 开始加载/home/app/qqbot/plugins/下的插件
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.mamoe.mirai.console.wrapper.WrapperMain.start(WrapperMain.kt:150)
at net.mamoe.mirai.console.wrapper.WrapperMain.preStartInNonNative(WrapperMain.kt:133)
at net.mamoe.mirai.console.wrapper.WrapperMain.main(WrapperMain.kt:89)
Caused by: java.lang.NoClassDefFoundError: org/yaml/snakeyaml/Yaml
at net.mamoe.mirai.console.plugins.YamlConfig.deserialize(ConfigSection.kt:527)
at net.mamoe.mirai.console.plugins.FileConfigImpl$content$2.invoke(ConfigSection.kt:443)
at net.mamoe.mirai.console.plugins.FileConfigImpl$content$2.invoke(ConfigSection.kt:428)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at net.mamoe.mirai.console.plugins.FileConfigImpl.getContent(ConfigSection.kt)
at net.mamoe.mirai.console.plugins.FileConfigImpl.get(ConfigSection.kt:476)
at net.mamoe.mirai.console.plugins.ConfigSection$DefaultImpls.getString(ConfigSection.kt:288)
at net.mamoe.mirai.console.plugins.FileConfigImpl.getString(ConfigSection.kt:428)
at net.mamoe.mirai.console.plugins.PluginDescription$Companion.readFromContent(PluginBase.kt:152)
at net.mamoe.mirai.console.plugins.PluginManager.loadPlugins(PluginManager.kt:91)
at net.mamoe.mirai.console.MiraiConsole.start(MiraiConsole.kt:85)
at net.mamoe.mirai.console.pure.MiraiConsolePureLoader$Companion.load(MiraiConsolePureLoader.kt:22)
at net.mamoe.mirai.console.pure.MiraiConsolePureLoader.load(MiraiConsolePureLoader.kt)
... 7 more
Caused by: java.lang.ClassNotFoundException: org.yaml.snakeyaml.Yaml
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
... 20 more
复现
把插件放进plugins文件夹 重启
出现问题
每次关闭都要等很久,也不知道是不是在关闭,建议加些提示性的日志进去监察进度
比如目前(2020-3-31 11:30)Jcenter炸了 导致mirai-console无法启动
能尽快完善下PluginStructure.md 吗?
当需要在插件中执行命令时, 由于无法检测命令是否完成, 造成了比较棘手的同步问题. 例如这一段插件中的登录代码(之所以需要用runConsoleCommand
登录而不是调用Bot.login()
是因为Bot.login()
的会和console争抢标准输入输出, 导致无法正常输入验证码)
// 启动一个异步块, 用于登录bot并且注册聊天指令
launch {
// 以控制台命令方式登录bot
MiraiConsole.CommandProcessor.runConsoleCommand(
"/login $qqNumber $password"
)
// ? ? ?
delay(10000)
// 获取到登陆的bot
val bot: Bot = try {
Bot.getInstance(qqNumber)
} catch (e: Exception) {
logger.error("Bot($qqNumber) login failed")
logger.error(e.toString())
logger.error(e.message)
return@launch
}
/* something else */
}
只有插入了一个较长的delay之后再获取Bot才能成功获取, 否则下面的语句在命令完成之前就被执行了. 即使使用runConsoleCommandBlocking
, 实际上也只是阻塞地把命令送入了commandChannel: Channel<FullCommand>
, 不过channel的内容仍然是由processNextCommandLine()
异步执行的, 因此该命令究竟何时完成并不确定. 尽管添加合适的delay可以解决这个问题, 但无论设置多长的时间, 使用delay()
仍然是一个很不稳定的方法.
由于采用了了异步的channel, 导致CommandManager.runCommand
的Boolean返回值无法通过runCommand返回. 可以考虑FullCommand
添加回调方法域, 给runCommand
等函数添加一个重载, 使得processNextCommandLine()
中可以在执行完成该命令后执行此回调方法.
现在经常出现文件损坏而无法启动的问题
java 插件 非public class XXXX extends PluginBase无法访问
要加accessible
报错如下:
19:43:28 [Bot Login]: login...
Exception in thread "DefaultDispatcher-worker-1" java.lang.NoSuchMethodError: kotlinx.serialization.internal.SerialClassDescImpl.(Ljava/lang/String;Lkotlinx/serialization/internal/GeneratedSerializer;I)V
at net.mamoe.mirai.utils.SystemDeviceInfo$$serializer.(SystemDeviceInfo.kt:43)
at net.mamoe.mirai.utils.SystemDeviceInfo$Companion.serializer(SystemDeviceInfo.kt)
at net.mamoe.mirai.utils.SystemDeviceInfoKt.loadAsDeviceInfo(SystemDeviceInfo.kt:31)
at net.mamoe.mirai.console.command.DefaultCommands$invoke$2$1$$special$$inlined$unaryPlus$1.invoke(BotConfigurationJvm.kt:222)
at net.mamoe.mirai.console.command.DefaultCommands$invoke$2$1$$special$$inlined$unaryPlus$1.invoke(BotConfigurationJvm.kt:160)
at net.mamoe.mirai.qqandroid.QQAndroidBotBase.(QQAndroidBot.kt:57)
at net.mamoe.mirai.qqandroid.QQAndroidBot.(QQAndroidBot.kt:38)
at net.mamoe.mirai.qqandroid.QQAndroid.newBot(QQAndroid.kt:34)
at net.mamoe.mirai.console.command.DefaultCommands$invoke$2$1.invokeSuspend(DefaultCommands.kt:278)
at net.mamoe.mirai.console.command.DefaultCommands$invoke$2$1.invoke(DefaultCommands.kt)
at net.mamoe.mirai.console.command.AnonymousCommand.onCommand(Command.kt:124)
at net.mamoe.mirai.console.command.CommandManager.runCommand$mirai_console(CommandManager.kt:55)
at net.mamoe.mirai.console.MiraiConsole$CommandProcessor.processNextCommandLine(MiraiConsole.kt:149)
at net.mamoe.mirai.console.MiraiConsole$CommandProcessor$processNextCommandLine$1.invokeSuspend(MiraiConsole.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:561)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:727)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:667)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:655)
日志如下
$ java -Xmx512M -jar mirai-console-wrapper-0.2.0-all.jar
You are running Mirai-Console-Wrapper under /home/app/qqbot
Starting Mirai Console Pure, reset by clear /content/
Starting version check...
Fetching Newest Core Version ..
Fetching Newest Console Version of Pure
Local Console-Pure Version: 0.4.2 | Newest Console-Pure Version: 0.4.2
Local Core Version: 0.32.0 | Newest Core Version: 0.32.0
Version check complete, starting Mirai
shadow-Protocol:/home/app/qqbot/content/mirai-core-qqandroid-jvm-0.32.0.jar
Console :/home/app/qqbot/content/mirai-console-0.4.2.jar
Root :/home/app/qqbot/
10:04:11 [INFO] [Mirai 0.4.2 Pkmon] Mirai-console now running under /home/app/qqbot
10:04:11 [INFO] [Mirai 0.4.2 Pkmon] Get news in github: https://github.com/mamoe/mirai
10:04:11 [INFO] [Mirai 0.4.2 Pkmon] Mirai为开源项目,请自觉遵守开源项目协议
10:04:11 [INFO] [Mirai 0.4.2 Pkmon] Powered by Mamoe Technologies and contributors
10:04:11 [INFO] [Plugin Manager] 开始加载/home/app/qqbot/plugins/下的插件
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.mamoe.mirai.console.wrapper.WrapperMain.start(WrapperMain.kt:150)
at net.mamoe.mirai.console.wrapper.WrapperMain.preStartInNonNative(WrapperMain.kt:133)
at net.mamoe.mirai.console.wrapper.WrapperMain.main(WrapperMain.kt:89)
Caused by: java.lang.NoClassDefFoundError: org/yaml/snakeyaml/Yaml
at net.mamoe.mirai.console.plugins.YamlConfig.deserialize(ConfigSection.kt:527)
at net.mamoe.mirai.console.plugins.FileConfigImpl$content$2.invoke(ConfigSection.kt:443)
at net.mamoe.mirai.console.plugins.FileConfigImpl$content$2.invoke(ConfigSection.kt:428)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at net.mamoe.mirai.console.plugins.FileConfigImpl.getContent(ConfigSection.kt)
at net.mamoe.mirai.console.plugins.FileConfigImpl.get(ConfigSection.kt:476)
at net.mamoe.mirai.console.plugins.ConfigSection$DefaultImpls.getString(ConfigSection.kt:288)
at net.mamoe.mirai.console.plugins.FileConfigImpl.getString(ConfigSection.kt:428)
at net.mamoe.mirai.console.plugins.PluginDescription$Companion.readFromContent(PluginBase.kt:152)
at net.mamoe.mirai.console.plugins.PluginManager.loadPlugins(PluginManager.kt:91)
at net.mamoe.mirai.console.MiraiConsole.start(MiraiConsole.kt:85)
at net.mamoe.mirai.console.pure.MiraiConsolePureLoader$Companion.load(MiraiConsolePureLoader.kt:22)
at net.mamoe.mirai.console.pure.MiraiConsolePureLoader.load(MiraiConsolePureLoader.kt)
... 7 more
Caused by: java.lang.ClassNotFoundException: org.yaml.snakeyaml.Yaml
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
... 20 more
把插件放进plugins文件夹 重启
出现问题
插件A 依赖 插件B
加载时顺序 插件B Main, 插件A Main
但是还不能确保onLoad/onEnable/onDisable 也是这个顺序
val groups: MutableList<Long> by config
对 groups 的修改并不会同步到 config.
是我的网络问题还是确实没有Java的示例项目。。。
并考虑动态(在图形端)修改配置
Received: Error(title=禁止登录, message=当前上网环境异常,请更换网络环境或在常用设备上登录或稍后再试。, errorInfo=)
这个应该怎么解决?
在机器人运行的过程中拉机器人去一个群里,在哪个新的群里机器人的主人不管怎么样都没权限
我强迫症犯了,看着这个黑乎乎的窗口,越来越不舒服按了个关闭然后界面什么的都没有了,我觉得需要个隐藏
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.