Closed beiyaohhhc closed 1 year ago
解决方法:这个错误呀,对比最新版的config.json改一下就好了,同时如果不是最新版最好再下载一下最新版2.4.4。 问题原因:更新版本后,代码默认配置文件结构更改,而你的配置文件未手动修改或删掉重新生成
解决方法:这个错误呀,对比最新版的config.json改一下就好了,同时如果不是最新版最好再下载一下最新版2.4.4。 问题原因:更新版本后,代码默认配置文件结构更改,而你的配置文件未手动修改或删掉重新生成
{ "agreeAutoApprove": { "friend": 1, "group": 0 }, "numControl": { "maxNum": 5, "time": 2, "unit":"h" }, "maxViewNum": 20, "recipientList": [], "forwardSet": 0, "blackDict": { "friend": { "text": [], "id": [] }, "group": { "text": [], "id": [] }, "forward": {} }, "warnDict": { "friend": { "text": [], "id": [] }, "group": { "text": [], "id": [] }, "forward": {} }, "allowAddFriednText": [], "botName": "我", "friend_msg": { "notice_msg": "请求添加好友,验证消息为", "welcome_msg": "我未知的的朋友啊,很高兴你添加我为qq好友哦!\n同时,如果有疑问,可以发送/help哦" }, "group_msg": { "notice_msg": "发送群邀请,验证消息为", "welcome_msg": "我亲爱的的朋友啊,很高兴你邀请我哦!" }, "statusDict": { "blackDict": { "friend": { "status": "拉黑QQ,已拒绝,仅作提示" }, "group": { "status": "拉黑群聊,已拒绝,仅作提示" } }, "warnDict": { "friend": { "status": "警告QQ,手动同意,是否同意" }, "group": { "status": "警告群聊,手动同意,是否同意" } } }}
现在改了直接没反应了(
又有报错
02-01 21:01:07 [ERROR] nonebot | Failed to import "nonebot_plugin_addFriend"
Traceback (most recent call last):
File "
File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot\plugin\manager.py", line 141, in load_plugin module = importlib.import_module(name) File "C:\Program Files\Python310\lib\importlib__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "
", line 1050, in _gcd_import File " ", line 1027, in _find_and_load File " ", line 1006, in _find_and_load_unlocked File " ", line 688, in _load_unlocked File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot\plugin\manager.py", line 233, in exec_module super().exec_module(module) File " ", line 883, in exec_module File " ", line 241, in _call_with_frames_removed File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot_plugin_addFriend__init.py", line 23, in from .configUtil import config,requestorDict,basedir,numPath,configPath,requestorPath,writeData,blackLogPath File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot_plugin_addFriend\configUtil.py", line 50, in init__.py", line 335, in loads raise JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig)", json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)config=readData(configPath,configModel) File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot_plugin_addFriend\configUtil.py", line 19, in readData data = json.loads(fp.read()) File "C:\Program Files\Python310\lib\json\
大概是json出了问题,你用编辑器看看config.json是不是多了个}
又有报错 02-01 21:01:07 [ERROR] nonebot | Failed to import "nonebot_plugin_addFriend" Traceback (most recent call last): File "", line 14, in File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot\plugin\load.py", line 122, in load_from_toml return load_all_plugins(plugins, plugin_dirs) File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot\plugin\load.py", line 59, in load_all_plugins return manager.load_all_plugins() File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot\plugin\manager.py", line 168, in load_all_plugins return set( File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot\plugin\manager.py", line 169, in filter(None, (self.load_plugin(name) for name in self.available_plugins))
File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot\plugin\manager.py", line 141, in load_plugin module = importlib.import_module(name) File "C:\Program Files\Python310\lib\importlibinit.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot\plugin\manager.py", line 233, in exec_module super().exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot_plugin_addFriendinit.py", line 23, in from .configUtil import config,requestorDict,basedir,numPath,configPath,requestorPath,writeData,blackLogPath File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot_plugin_addFriend\configUtil.py", line 50, in config=readData(configPath,configModel) File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot_plugin_addFriend\configUtil.py", line 19, in readData data = json.loads(fp.read()) File "C:\Program Files\Python310\lib\jsoninit.py", line 335, in loads raise JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig)", json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0) 你对config.json进行了什么操作?
解决方法:这个错误呀,对比最新版的config.json改一下就好了,同时如果不是最新版最好再下载一下最新版2.4.4。问题原因:更新版本后,代码默认配置文件结构更改,而你的配置文件未手动修改或删掉重新生成
{ "agreeAutoApprove": { "friend": 1, "group": 0 }, "numControl": { "maxNum": 5, "time": 2, "unit":"h" }, "maxViewNum": 20, "recipientList": [], "forwardSet": 0, "blackDict": { "friend": { "text": [], "id": [] }, "group": { "text": [], "id": [] }, "forward": {} }, "warnDict": { "friend": { "text": [], "id": [] }, "group": { "text": [], "id": [] }, "forward": {} }, "allowAddFriednText": [], "botName": "我", "friend_msg": { "notice_msg": "请求添加好友,验证消息为", "welcome_msg": "我未知的的朋友啊,很高兴你添加我为qq好友哦!\n同时,如果有疑问,可以发送/help哦" }, "group_msg": { "notice_msg": "发送群邀请,验证消息为", "welcome_msg": "我亲爱的的朋友啊,很高兴你邀请我哦!" }, "statusDict": { "blackDict": { "friend": { "status": "拉黑QQ,已拒绝,仅作提示" }, "group": { "status": "拉黑群聊,已拒绝,仅作提示" } }, "warnDict": { "friend": { "status": "警告QQ,手动同意,是否同意" }, "group": { "status": "警告群聊,手动同意,是否同意" } } }}
把这段复制进去了而已
那还真是多了个},最后一个},刚才更新readme了
出现如下报错
02-01 21:41:15 [ERROR] nonebot | Failed to import "nonebot_plugin_addFriend"
Traceback (most recent call last):
File "
File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot\plugin\manager.py", line 141, in load_plugin module = importlib.import_module(name) File "C:\Program Files\Python310\lib\importlib__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "
", line 1050, in _gcd_import File " ", line 1027, in _find_and_load File " ", line 1006, in _find_and_load_unlocked File " ", line 688, in _load_unlocked File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot\plugin\manager.py", line 233, in exec_module super().exec_module(module) File " ", line 883, in exec_module File " ", line 241, in _call_with_frames_removed File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot_plugin_addFriend__init.py", line 23, in from .configUtil import config,requestorDict,basedir,numPath,configPath,requestorPath,writeData,blackLogPath File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot_plugin_addFriend\configUtil.py", line 50, in init__.py", line 346, in loads return _default_decoder.decode(s) File "C:\Program Files\Python310\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Program Files\Python310\lib\json\decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting ',' delimiter: line 2 column 1 (char 816)config=readData(configPath,configModel) File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot_plugin_addFriend\configUtil.py", line 19, in readData data = json.loads(fp.read()) File "C:\Program Files\Python310\lib\json\
哈哈,忙猜一波,少了一个},刚才更新过,已经不多}也不少}了
{ "agreeAutoApprove": { "friend": 1, "group": 0 }, "numControl": {"maxNum":5,"time":2,"unit":"h"}, "maxViewNum":20, "recipientList": [], "forwardSet":0, "blackDict":{"friend":{"text":[],"id":[]},"group":{"text":[],"id":[]},"forward":{}}, "warnDict":{"friend":{"text":[],"id":[]},"group":{"text":[],"id":[]},"forward":{}}, "allowAddFriednText":[], "botName": "我", "friend_msg": { "notice_msg": "请求添加好友,验证消息为", "welcome_msg": "我未知的的朋友啊,很高兴你添加我为qq好友哦!\n同时,如果有疑问,可以发送/help哦" }, "group_msg": { "notice_msg": "发送群邀请,验证消息为", "welcome_msg": "我亲爱的的朋友啊,很高兴你邀请我哦!" }, "statusDict":{ "blackDict":{"friend":{"status":"拉黑QQ,已拒绝,仅作提示"},"group":{"status":"拉黑群聊,已拒绝,仅作提示"}}, "warnDict":{"friend":{"status":"警告QQ,手动同意,是否同意"},"group":{"status":"警告群聊,手动同意,是否同意"}} } }
啊 行了 谢谢
啊 行了 谢谢
其实删掉重新启动就自动生成新的了,没必要自己复制。 自己复制后记得填充超管qq号,"recipientList": ["qq号"],
啊 行了 谢谢
其实删掉重新启动就自动生成新的了,没必要自己复制。 自己复制后记得填充超管qq号,"recipientList": ["qq号"],
自己复制出来的recipientList(接收者列表)是空的,不像自动生成的那样会自动生成
谢谢提醒
啊这 改个超管又报错了
02-01 21:55:24 [ERROR] nonebot | Failed to import "nonebot_plugin_addFriend"
Traceback (most recent call last):
File "
File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot\plugin\manager.py", line 141, in load_plugin module = importlib.import_module(name) File "C:\Program Files\Python310\lib\importlib__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "
", line 1050, in _gcd_import File " ", line 1027, in _find_and_load File " ", line 1006, in _find_and_load_unlocked File " ", line 688, in _load_unlocked File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot\plugin\manager.py", line 233, in exec_module super().exec_module(module) File " ", line 883, in exec_module File " ", line 241, in _call_with_frames_removed File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot_plugin_addFriend__init.py", line 23, in from .configUtil import config,requestorDict,basedir,numPath,configPath,requestorPath,writeData,blackLogPath File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot_plugin_addFriend\configUtil.py", line 50, in init__.py", line 346, in loads return _default_decoder.decode(s) File "C:\Program Files\Python310\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Program Files\Python310\lib\json\decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 147 (char 146)config=readData(configPath,configModel) File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot_plugin_addFriend\configUtil.py", line 19, in readData data = json.loads(fp.read()) File "C:\Program Files\Python310\lib\json\
改一个改两个都是上面错误
估计是这里多了一个", 直接删了然后重启程序自动生成吧
02-01 22:20:31 [ERROR] nonebot | Failed to import "nonebot_plugin_addFriend"
Traceback (most recent call last):
File "
File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot\plugin\manager.py", line 141, in load_plugin module = importlib.import_module(name) File "C:\Program Files\Python310\lib\importlib__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "
", line 1050, in _gcd_import File " ", line 1027, in _find_and_load File " ", line 1004, in _find_and_load_unlocked ModuleNotFoundError: No module named 'nonebot_plugin_addFriend'
好家伙,我是让你删config.json,不是让你把插件删了
啊 终于好了 睡觉
报错如下 02-01 11:58:55 [ERROR] nonebot | Running Matcher(type='request', module=nonebot_plugin_addFriend) failed. Traceback (most recent call last): File "", line 17, in
File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot__init__.py", line 273, in run
get_driver().run(*args, *kwargs)
File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot\drivers\fastapi.py", line 187, in run
uvicorn.run(
File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\uvicorn\main.py", line 569, in run
server.run()
File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\uvicorn\server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "C:\Program Files\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 636, in run_until_complete
self.run_forever()
File "C:\Program Files\Python310\lib\asyncio\windows_events.py", line 321, in run_forever
super().run_forever()
File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 603, in run_forever
self._run_once()
File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 1906, in _run_once
handle._run()
File "C:\Program Files\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, self._args)
File "C:\Users\Administrator\Desktop\nonebot-test\empty\venv\lib\site-packages\nonebot\message.py", line 141, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)