编码错误,重写后问题解决
1
1479412322 发布的帖子
-
RE: 使用nonebot的Mirai-API-HTTP 协议时发生错误
官方文档:省略了部分无需修改的部分
配置文件:
.envENVIRONMENT=dev HOST=127.0.0.1 # 当MAH运行在本机时 PORT=2333 MIRAI_AUTH_KEY=******** MIRAI_HOST=127.0.0.1 # 当MAH运行在本机时 MIRAI_PORT=8080 # MAH的监听端口 SUPERUSERS=["********"] # 配置 NoneBot 超级用户 NICKNAME=["bot"] # 配置机器人的昵称 COMMAND_START=["/", ""] # 配置命令起始字符 COMMAND_SEP=["."] # 配置命令分割字符
setting.yml(MAH)
host: 0.0.0.0 port: 8080 authKey: ******** ## 消息上报 report: enable: true # 必须为true groupMessage: report: true # 群消息上报 friendMessage: report: true # 好友消息上报 tempMessage: report: true # 临时会话上报 eventMessage: report: true # 事件上报 destinations: ["http://127.0.0.1:2333/mirai/http"] #上报地址, 请按照实际情况修改
-
使用nonebot的Mirai-API-HTTP 协议时发生错误
使用nonebot的Mirai-API-HTTP 协议时发生错误(POST 消息上报 )
2021-07-09 13:44:37 E/net.mamoe.mirai-api-http: net.mamoe.yamlkt.YamlDecodingException: There must be a COLON between class key and value but found STRING for 'setting' p o r t : 8 0 8 0 ^ at line 3, column 11 net.mamoe.yamlkt.YamlDecodingException: There must be a COLON between class key and value but found STRING for 'setting' p o r t : 8 0 8 0 ^ at line 3, column 11 at net.mamoe.yamlkt.internal.YamlUtils__ContextualExceptionKt.contextualDecodingException(ContextualException.kt:154) at net.mamoe.yamlkt.internal.YamlUtils.contextualDecodingException(Unknown Source) at net.mamoe.yamlkt.internal.YamlUtils__ContextualExceptionKt.contextualDecodingException$default(ContextualException.kt:128) at net.mamoe.yamlkt.internal.YamlUtils.contextualDecodingException$default(Unknown Source) at net.mamoe.yamlkt.internal.YamlDecoder$BlockClassDecoder.decodeElementIndex(YamlDecoder.kt:285) at net.mamoe.yamlkt.internal.YamlDecoder$BlockClassDecoder.decodeElementIndex(YamlDecoder.kt:292) at net.mamoe.mirai.console.internal.data.PluginDataImpl$updaterSerializer$1.deserialize(PluginDataImpl.kt:75) at net.mamoe.mirai.console.internal.data.PluginDataImpl$updaterSerializer$1.deserialize(PluginDataImpl.kt:47) at net.mamoe.yamlkt.Yaml.decodeFromString(Yaml.kt:162) at net.mamoe.mirai.console.internal.data.MultiFilePluginDataStorageImpl.load(MultiFilePluginDataStorageImpl.kt:39) at net.mamoe.mirai.console.plugin.jvm.AbstractJvmPlugin.reloadPluginConfig(AbstractJvmPlugin.kt:58) at net.mamoe.mirai.api.http.HttpApiPluginBase.onEnable(HttpApiPluginBase.kt:30) 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:119) 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) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.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.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.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:101) at org.itxtech.mcl.Loader.start(Loader.java:156) at org.itxtech.mcl.Loader.main(Loader.java:66)