@exziro 有r18啊,我的还能用
Y
Ycituss 发布的帖子
-
插件之间的不正常调用
我用同样的指令结构和文件结构写了两个插件,我是用在两个不同的机器人上的,使用没有问题,但是放在同一个 Mirai Console里面,就会出现奇怪的问题。
setu
private PluginMain() { super(new JvmPluginDescriptionBuilder("com.ycitus.setu", "3.5.0") .name("Setu") .author("ycitus") .build()); }
mcping
private MinecraftPing() { super(new JvmPluginDescriptionBuilder("com.ycitus.MinecraftPing", "1.0-SNAPSHOT") .name("MinecraftPing") .author("Ycitus") .build()); }
日志
2021-09-08 16:38:49 I/MinecraftPing: MinecraftPing >> Enable. 2021-09-08 16:38:49 I/MinecraftPing: Start Init... 2021-09-08 16:38:49 I/MinecraftPing: [FileSystem] Init FileSystem. 2021-09-08 16:38:49 I/MinecraftPing: [FileSystem] Init All Configs... 2021-09-08 16:38:49 I/MinecraftPing: [FileSystem] Init >> ApplicationConfig.json 2021-09-08 16:38:49 I/MinecraftPing: [FileSystem] Load Local File to Memory >> ApplicationConfig.json 2021-09-08 16:38:49 I/MinecraftPing: [CommandSystem] Init CommandSystem. 2021-09-08 16:38:49 I/MinecraftPing: [TimerSystem] Start TimerSystem. 2021-09-08 16:38:49 I/MinecraftPing: McPing End Init... 2021-09-08 16:38:49 I/MinecraftPing: Setu >> Enable. 2021-09-08 16:38:49 I/MinecraftPing: Start Init... 2021-09-08 16:38:49 I/MinecraftPing: [FileSystem] Init FileSystem. 2021-09-08 16:38:49 I/MinecraftPing: [CommandSystem] Init CommandSystem. 2021-09-08 16:38:49 I/MinecraftPing: End Init...
可以看到,写在setu的onEnable()函数里的输出显示输出插件为mcping
同时setu插件的功能也无法正常使用,监听事件失效。有没有大佬知道是为什么
-
Groups获取失败
mirai版本 2.7.0
使用了如下代码获取群列表
public static ContactList<Group> getAllQQGroups() { return MinecraftPing.getCurrentBot().getGroups(); }
控制台报错
java.lang.NullPointerException at com.ycitus.framework.BotManager.getAllQQGroups(BotManager.java:13) at com.ycitus.MinecraftPing.onEnable(MinecraftPing.java:68) 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:208) 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)
机器人是加了群的
有没有大佬知道是为什么