- 👨🏻🎓A Chinese Student
- 🐠Touch fish~
- 🐤Just a Rookie
- 🤖Developing a NovelAI script
- Genshin Impact
- Forza Horizon
- Azure Lane
- Snowbreak: Containment Zone
- Wuthering Waves
- ...
基于 NoneBot 的 QQ 机器人——脑积水!
Home Page: https://zhulinyv.github.io/NJS
License: GNU Affero General Public License v3.0
运行时最后报错
nonebot | Running NoneBot...
Downloading Chromium 107.0.5304.18 (playwright build v1028) - 109.2 Mb [====================] 100% 0.0s
Chromium 107.0.5304.18 (playwright build v1028) downloaded to C:\Users\shubi\AppData\Local\ms-playwright\chromium-1028
Downloading FFMPEG playwright build v1007 - 1.4 Mb [====================] 100% 0.0s
FFMPEG playwright build v1007 downloaded to C:\Users\shubi\AppData\Local\ms-playwright\ffmpeg-1007
06-17 22:51:14 [WARNING] apscheduler | Run time of job "_restart (trigger: interval[0:00:05], next run at: 2023-06-17 22:51:18 CST)" was missed by 0:00:01.376822
06-17 22:51:25 [ERROR] uvicorn | Traceback (most recent call last):
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-P4dbqrGV-py3.10\lib\site-packages\starlette\routing.py", line 671, in lifespan
async with self.lifespan_context(app):
File "C:\software\Python310\lib\contextlib.py", line 199, in aenter
return await anext(self.gen)
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-P4dbqrGV-py3.10\lib\site-packages\nonebot\drivers\fastapi.py", line 165, in _lifespan_manager
await self._lifespan.startup()
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-P4dbqrGV-py3.10\lib\site-packages\nonebot\drivers_lifespan.py", line 35, in startup
await self._run_lifespan_func(self._startup_funcs)
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-P4dbqrGV-py3.10\lib\site-packages\nonebot\drivers_lifespan.py", line 29, in run_lifespan_func
await cast(ASYNC_LIFESPAN_FUNC, func)()
File "C:\software\NJS-Bot\src\plugins\nonebot_plugin_moegoe_init.py", line 58, in update
os.rename(profilePath, bakProfilePath)
FileNotFoundError: [WinError 3] 系统找不到指定的路径。: 'data\moegoe\profile.toml' -> 'data\moegoe\profile.bak'
06-17 22:51:25 [ERROR] uvicorn | Application startup failed. Exiting.
在esxi8.0的all in one的虚拟机中装的,不知道是不是这个问题
膜拜大佬顺便把签到插件(sign_in)借来用
我进行签到的时候返回了错误值:
File "C:\Users\KaMmy\Desktop\bot\gocq\yuban.\src\plugins\sign_in_init_.py", line 29, in lj
money = data_user[f'{qq_id}']
KeyError: '2660638311'
查看相关代码:
# 签到
with open(file_name) as f:
data_user = json.load(f)
money = data_user[f'{qq_id}']
似乎是没有给第一次签到的用户赋予初始好感度导致的。
赋值初始好感度后程序正常运行:
# 签到
with open(file_name) as f:
data_user = json.load(f)
if qq_id in data_user:
money = data_user[str(qq_id)]
else:
money = 0 # 如果用户没有签到过,则初始好感度为0
咱是初学者,如有不对欢迎大佬指正
nonebot_plugin_wordcloud 会导致项目无法启动,这个插件似乎需要手动配置数据库,我在启动时报错:
alembic.util.exc.CommandError: Can't locate revision identified by '9bca28bcb998'
经过排查发现是词云图插件初始化了nonebot_plugin_datastore插件,但是这个插件版本似乎有问题。
他需要配置alembic.ini配置文件来连接数据库,但是项目以及依赖里没有相应配置,
我不清楚它是否会自动生成一个本地数据库,所以只能先将词云图插件注释使用
建议修复或者注释掉此插件
requirements.bat
更新依赖库简单的描述问题发生过程或表现...
首次启动时因playwright的问题报错并异常退出,尝试手动安装playwright后又因为firefox不能正常安装而报错
日志和截图如下
提供问题或日志截图...
首次启动时因playwright的问题报错并异常退出的日志和截图
NJSCrash-06-27.txt
尝试手动执行playwright install后又因为firefox安装异常报错
描述问题复现过程...
1.尝试以poetry run python bot.py运行NJS playwright报错
2.根据报错内容执行指令poetry run playwright install又报错
此前尝试使用魔法上网 重新尝试启动NJS都没能成功
完整日志如下
NJSCrashFull-06-27.txt
我的问题可能很lowiq 麻烦大佬们原谅,指点。谢谢。
apibug.cn域名已经更换
为:api.apibug.com
更新到最新版本后启动时报错,看更新依赖时候貌似是成功更新了html什么的还有个redis
报错的插件分别是setu和nonebot_plugin_stable_diffusion_diao
github传截图不知道为什么一直不成功,只能复制出来了= =
[ERROR] nonebot | Failed to import "nonebot_plugin_setu4"
Traceback (most recent call last):
File "G:\NJS-Bot\bot.py", line 31, in <module>
nonebot.load_from_toml("pyproject.toml")
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\nonebot\plugin\load.py", line 125, in load_from_toml
return load_all_plugins(plugins, plugin_dirs)
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\nonebot\plugin\load.py", line 62, in load_all_plugins
return manager.load_all_plugins()
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\nonebot\plugin\manager.py", line 175, in load_all_plugins
return set(
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\nonebot\plugin\manager.py", line 176, in <genexpr>
filter(None, (self.load_plugin(name) for name in self.available_plugins))
> File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\nonebot\plugin\manager.py", line 145, in load_plugin
module = importlib.import_module(
File "C:\software\Python310\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\nonebot\plugin\manager.py", line 241, in exec_module
super().exec_module(module)
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "G:\NJS-Bot\src\plugins\nonebot_plugin_setu4\__init__.py", line 8, in <module>
from .mamager_handle import manager_handle
File "G:\NJS-Bot\src\plugins\nonebot_plugin_setu4\mamager_handle.py", line 8, in <module>
from .fetch_resources import download_database
File "G:\NJS-Bot\src\plugins\nonebot_plugin_setu4\fetch_resources.py", line 7, in <module>
from .config import config
File "G:\NJS-Bot\src\plugins\nonebot_plugin_setu4\config.py", line 30, in <module>
config = Config.parse_obj(get_driver().config)
File "pydantic\main.py", line 527, in pydantic.main.BaseModel.parse_obj
return cls(**obj)
File "pydantic\env_settings.py", line 39, in pydantic.env_settings.BaseSettings.__init__
super().__init__(
File "pydantic\main.py", line 342, in pydantic.main.BaseModel.__init__
raise validation_error
pydantic.error_wrappers.ValidationError: 2 validation errors for Config
setu_disable_wlist
value could not be parsed to a boolean (type=type_error.bool)
setu_enable_private
value could not be parsed to a boolean (type=type_error.bool)
[ERROR] nonebot | Failed to import "nonebot_plugin_stable_diffusion_diao"
Traceback (most recent call last):
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\redis\connection.py", line 707, in connect
sock = self.retry.call_with_retry(
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\redis\retry.py", line 46, in call_with_retry
return do()
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\redis\connection.py", line 708, in <lambda>
lambda: self._connect(), lambda error: self.disconnect(error)
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\redis\connection.py", line 1006, in _connect
raise err
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\redis\connection.py", line 994, in _connect
sock.connect(socket_address)
ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "G:\NJS-Bot\bot.py", line 31, in <module>
nonebot.load_from_toml("pyproject.toml")
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\nonebot\plugin\load.py", line 125, in load_from_toml
return load_all_plugins(plugins, plugin_dirs)
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\nonebot\plugin\load.py", line 62, in load_all_plugins
return manager.load_all_plugins()
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\nonebot\plugin\manager.py", line 175, in load_all_plugins
return set(
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\nonebot\plugin\manager.py", line 176, in <genexpr>
filter(None, (self.load_plugin(name) for name in self.available_plugins))
> File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\nonebot\plugin\manager.py", line 145, in load_plugin
module = importlib.import_module(
File "C:\software\Python310\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\nonebot\plugin\manager.py", line 241, in exec_module
super().exec_module(module)
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "G:\NJS-Bot\src\plugins\nonebot_plugin_stable_diffusion_diao\__init__.py", line 1, in <module>
from . import config, manage
File "G:\NJS-Bot\src\plugins\nonebot_plugin_stable_diffusion_diao\config.py", line 357, in <module>
redis_client = asyncio.run(main())
File "C:\software\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\software\Python310\lib\asyncio\base_events.py", line 649, in run_until_complete
return future.result()
File "G:\NJS-Bot\src\plugins\nonebot_plugin_stable_diffusion_diao\config.py", line 298, in main
resp = r1.ping()
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\redis\commands\core.py", line 1205, in ping
return self.execute_command("PING", **kwargs)
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\redis\client.py", line 1266, in execute_command
conn = self.connection or pool.get_connection(command_name, **options)
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\redis\connection.py", line 1461, in get_connection
connection.connect()
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\redis\connection.py", line 713, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 10061 connecting to localhost:6379. 由于目标计算机积极拒绝,无法连接。.
正常启动
戳一戳会触发
[CQ:record,file=file:///D:/NJS-Bot/src/plugins/smart_reply/resource/audio/%E4%BD%A0%E5%AF%84%E5%90%A7%E8%B0%81%E5%95%8A%28%E6%8C%AF%E5%A3%B0%21%29.aac,magic=,cache=,proxy=,timeout=]
戳一戳
使用时报错
07-12 20:49:03 [ERROR] nonebot | Running Matcher(type='message', module=src.plugins.nonebot_plugin_setu4) failed.
Traceback (most recent call last):
File "G:\NJS-Bot\bot.py", line 41, in
nonebot.run(app="mp_main:app", access_log=False)
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\nonebot_init_.py", line 309, in run
get_driver().run(*args, **kwargs)
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\nonebot\drivers\fastapi.py", line 198, in run
uvicorn.run(
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\uvicorn\main.py", line 578, in run
server.run()
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\uvicorn\server.py", line 61, in run
return asyncio.run(self.serve(sockets=sockets))
File "C:\software\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\software\Python310\lib\asyncio\base_events.py", line 636, in run_until_complete
self.run_forever()
File "C:\software\Python310\lib\asyncio\windows_events.py", line 321, in run_forever
super().run_forever()
File "C:\software\Python310\lib\asyncio\base_events.py", line 603, in run_forever
self._run_once()
File "C:\software\Python310\lib\asyncio\base_events.py", line 1909, in _run_once
handle._run()
File "C:\software\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\nonebot\message.py", line 467, in check_and_run_matcher
await run_matcher(
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\nonebot\message.py", line 419, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\nonebot\internal\matcher\matcher.py", line 753, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\nonebot\internal\matcher\matcher.py", line 728, in simple_run
await handler(
File "C:\Users\shubi\AppData\Local\pypoetry\Cache\virtualenvs\njs-06ksLelh-py3.10\lib\site-packages\nonebot\dependencies_init.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "G:\NJS-Bot\src\plugins\nonebot_plugin_setu4_init.py", line 85, in _
args = list(state["_matched_groups"])
KeyError: '_matched_groups'
使用此插件
进入虚拟环境后nb run,最后出现Application startup failed. Exiting.
03-11 11:07:58 [SUCCESS] LittlePaimon | [数据库]连接成功
03-11 11:07:58 [SUCCESS] LittlePaimon | [插件管理器]初始化完成
03-11 11:07:58 [INFO] LittlePaimon | [资源检查]开始检查资源
03-11 11:07:58 [WARNING] nonebot_plugin_memes | Error downloading https://ghproxy.com/https://raw.githubusercontent.com/noneplugin/nonebot-plugin-memes/v0.3.x/resources/thumbs/shuifandui.jpg, retry 1/3:
03-11 11:07:58 [WARNING] LittlePaimon | [资源检查]读取资源列表失败,请尝试更换github资源地址
03-11 11:07:58 [INFO] LittlePaimon | [Playwright]浏览器初始化成功
03-11 11:07:59 [ERROR] uvicorn | Traceback (most recent call last):
File "/home/benson/.cache/pypoetry/virtualenvs/njs-TuGSxenq-py3.10/lib/python3.10/site-packages/starlette/routing.py", line 671, in lifespan
async with self.lifespan_context(app):
File "/home/benson/.cache/pypoetry/virtualenvs/njs-TuGSxenq-py3.10/lib/python3.10/site-packages/starlette/routing.py", line 566, in aenter
await self._router.startup()
File "/home/benson/.cache/pypoetry/virtualenvs/njs-TuGSxenq-py3.10/lib/python3.10/site-packages/starlette/routing.py", line 648, in startup
await handler()
File "/home/benson/NJS/./LittlePaimon/plugins/Paimon_Chat/init.py", line 103, in load_voice
voice_list = await load_json_from_url('https://static.cherishmoon.fun/LittlePaimon/voice/voice_list.json', path)
File "/home/benson/.cache/pypoetry/virtualenvs/njs-TuGSxenq-py3.10/lib/python3.10/site-packages/littlepaimon_utils/files.py", line 73, in load_json_from_url
data = resp.json()
File "/home/benson/.cache/pypoetry/virtualenvs/njs-TuGSxenq-py3.10/lib/python3.10/site-packages/httpx/_models.py", line 1516, in json
return jsonlib.loads(self.content.decode(encoding), **kwargs)
File "/usr/local/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
03-11 11:07:59 [ERROR] uvicorn | Application startup failed. Exiting.
描述问题复现过程...
ubantu20.04
python3.10.9
按照流程走了一遍是nonebot没安装吗?
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.