基于 NoneBot 的QQ机器人
实现了一些乱七八糟的功能
本项目是自用bot项目,并不是开箱即用的,但可以提供某些插件功能上的思路,有问题也可以提issue。
pip install poetry
poetry install
sudo apt install ffmpeg imagemagick texlive-full poppler-utils
License: MIT License
基于 NoneBot 的QQ机器人
实现了一些乱七八糟的功能
本项目是自用bot项目,并不是开箱即用的,但可以提供某些插件功能上的思路,有问题也可以提issue。
pip install poetry
poetry install
sudo apt install ffmpeg imagemagick texlive-full poppler-utils
仔细看了代码发现最终指向.env.dev但并未提供网址
您好,我注意到您的插件管理器 manager
在执行 禁用/启用 指令的时候直接调用了 nonebot_plugin_manager
的 plugin_manager.block_plugin()
方法但并没有验证当前禁用/启用的插件在当前会话是否可写,这应该会导致非超级用户的群管理、群主也可以开关 help 中灰色行(也就是 plugin.locked == True
)的插件。
plugin_manager.block_plugin()
方法本身是并不带有可写权限检测的,nonebot_plugin_manager
也是在 npm block
的 Handle 中先判断了是否可写才去执行 block 。
RT,font文件很大,如果每个插件都配在单独一个插件文件夹下面会比较浪费空间(然而好像也浪费不了多少?)
指的是petpet和memes这些需要字体的插件
每一岁一条消息的话,我这边不夭折的remake都会被风控
我改成每十岁合并成一条消息后发送倒是没问题了XD
(不知道是不是我这边的偶发情况
http_proxy=http://192.168.1.112:7890 # 代理,如:http://127.0.0.1:1080
https_proxy=https://192.168.1.112:7890
socks_proxy=
no_proxy=127.0.0.1,localhost
我按照以上的配置在.env.prod中配置了代理,但是所有需要下载的插件全部报连接超时错误。(已确定代理服务器没有问题,谷歌等正常访问),大佬能帮忙看下嘛
环境:Ubuntu20.04LTS 在poetry
中配置后 nb run
运行
RT
把wolfram复制到plugin文件夹后启动bot, bot无法加载这个插件(
`(bot) justin@JustindeMacBook-Pro uuz % nb run
10-13 18:47:38 [SUCCESS] nonebot | NoneBot is initializing...
10-13 18:47:38 [INFO] nonebot | Current Env: dev
10-13 18:47:38 [DEBUG] nonebot | Loaded Config: {'driver': '~fastapi', 'host': IPv4Address('127.0.0.1'), 'port': 8080, 'log_level': 'DEBUG', 'api_timeout': 30.0, 'superusers': set(), 'nickname': set(), 'command_start': {'/'}, 'command_sep': {'.'}, 'session_expire_timeout': datetime.timedelta(seconds=120), 'fastapi_reload': True, 'apscheduler_autostart': True, 'environment': 'dev', 'wolframalpha_appid': ''}
10-13 18:47:39 [DEBUG] nonebot | Succeeded to load adapter "OneBot V11"
10-13 18:47:39 [ERROR] nonebot | Failed to import "nonebot_plugin_fg"
Traceback (most recent call last):
File "/Users/justin/opt/miniconda3/envs/bot/bin/nb", line 8, in
sys.exit(main())
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nb_cli/commands/main.py", line 30, in run
run_bot(file, app)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nb_cli/handlers/deploy.py", line 20, in run_bot
module = importlib.import_module(module_name)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/Users/justin/QQbot/uuz/./bot.py", line 22, in
nonebot.load_plugin('nonebot_plugin_fg')
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/load.py", line 34, in load_plugin
return manager.load_plugin(module_path)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 141, in load_plugin
module = importlib.import_module(name)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot_plugin_fg/init.py", line 25, in
from .core import *
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot_plugin_fg/core.py", line 28, in
from .base import get_config_list, get_scheduler, get_sys_config
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot_plugin_fg/base.py", line 29, in
import nonebot_plugin_apscheduler
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot_plugin_apscheduler/init.py", line 3, in
from nonebot import export, get_driver
ImportError: cannot import name 'export' from 'nonebot' (/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/init.py)
10-13 18:47:39 [SUCCESS] nonebot | Succeeded to import "echo"
10-13 18:47:39 [SUCCESS] nonebot | Succeeded to import "tex"
10-13 18:47:39 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_htmlrender"
10-13 18:47:40 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_status"
10-13 18:47:40 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_code"
10-13 18:47:40 [ERROR] nonebot | Failed to import "nonebot_plugin_mcstatus"
Traceback (most recent call last):
File "/Users/justin/opt/miniconda3/envs/bot/bin/nb", line 8, in
sys.exit(main())
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nb_cli/commands/main.py", line 30, in run
run_bot(file, app)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nb_cli/handlers/deploy.py", line 20, in run_bot
module = importlib.import_module(module_name)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/Users/justin/QQbot/uuz/./bot.py", line 27, in
nonebot.load_from_toml("pyproject.toml")
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/load.py", line 122, in load_from_toml
return load_all_plugins(plugins, plugin_dirs)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/load.py", line 59, in load_all_plugins
return manager.load_all_plugins()
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 168, in load_all_plugins
return set(
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 169, in
filter(None, (self.load_plugin(name) for name in self.available_plugins))
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 141, in load_plugin
module = importlib.import_module(name)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot_plugin_mcstatus/init.py", line 4, in
from mcstatus import MinecraftServer
ImportError: cannot import name 'MinecraftServer' from 'mcstatus' (/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/mcstatus/init.py)
10-13 18:47:40 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_manager"
10-13 18:47:40 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_moegoe"
10-13 18:47:40 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_help"
10-13 18:47:40 [ERROR] nonebot | Failed to import "wolfram"
Traceback (most recent call last):
File "/Users/justin/opt/miniconda3/envs/bot/bin/nb", line 8, in
sys.exit(main())
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nb_cli/commands/main.py", line 30, in run
run_bot(file, app)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nb_cli/handlers/deploy.py", line 20, in run_bot
module = importlib.import_module(module_name)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/Users/justin/QQbot/uuz/./bot.py", line 27, in
nonebot.load_from_toml("pyproject.toml")
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/load.py", line 122, in load_from_toml
return load_all_plugins(plugins, plugin_dirs)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/load.py", line 59, in load_all_plugins
return manager.load_all_plugins()
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 168, in load_all_plugins
return set(
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 169, in
filter(None, (self.load_plugin(name) for name in self.available_plugins))
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 145, in load_plugin
module = importlib.import_module(
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "/Users/justin/QQbot/uuz/./uuz/plugins/wolfram/init.py", line 6, in
from .data_source import get_wolframalpha_simple, get_wolframalpha_text
File "/Users/justin/QQbot/uuz/./uuz/plugins/wolfram/data_source.py", line 4, in
import wolframalpha
ModuleNotFoundError: No module named 'wolframalpha'
10-13 18:47:40 [ERROR] nonebot | Failed to import "nonebot_plugin_autohelp"
Traceback (most recent call last):
File "/Users/justin/opt/miniconda3/envs/bot/bin/nb", line 8, in
sys.exit(main())
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nb_cli/commands/main.py", line 30, in run
run_bot(file, app)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nb_cli/handlers/deploy.py", line 20, in run_bot
module = importlib.import_module(module_name)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/Users/justin/QQbot/uuz/./bot.py", line 27, in
nonebot.load_from_toml("pyproject.toml")
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/load.py", line 122, in load_from_toml
return load_all_plugins(plugins, plugin_dirs)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/load.py", line 59, in load_all_plugins
return manager.load_all_plugins()
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 168, in load_all_plugins
return set(
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 169, in
filter(None, (self.load_plugin(name) for name in self.available_plugins))
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 141, in load_plugin
module = importlib.import_module(name)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot_plugin_autohelp/init.py", line 7, in
from .nonebot_plugin_autohelp import nonebot_plugin_autohelp
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot_plugin_autohelp/nonebot_plugin_autohelp.py", line 19, in
from nonebot.params import State
ImportError: cannot import name 'State' from 'nonebot.params' (/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/params.py)
10-13 18:47:44 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_imageutils"
10-13 18:47:51 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_petpet"
10-13 18:47:51 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_withdraw"
10-13 18:47:51 [SUCCESS] nonebot | Running NoneBot...
10-13 18:47:51 [DEBUG] nonebot | Loaded adapters: OneBot V11
10-13 18:47:51 [INFO] uvicorn | Will watch for changes in these directories: ['/Users/justin/QQbot/uuz']
10-13 18:47:51 [INFO] uvicorn | Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
10-13 18:47:51 [INFO] uvicorn | Started reloader process [15333] using WatchFiles
10-13 18:47:53 [SUCCESS] nonebot | NoneBot is initializing...
10-13 18:47:53 [INFO] nonebot | Current Env: dev
10-13 18:47:53 [DEBUG] nonebot | Loaded Config: {'driver': '~fastapi', 'host': IPv4Address('127.0.0.1'), 'port': 8080, 'log_level': 'DEBUG', 'api_timeout': 30.0, 'superusers': set(), 'nickname': set(), 'command_start': {'/'}, 'command_sep': {'.'}, 'session_expire_timeout': datetime.timedelta(seconds=120), 'apscheduler_autostart': True, 'wolframalpha_appid': '', 'fastapi_reload': True, 'environment': 'dev'}
10-13 18:47:53 [DEBUG] nonebot | Succeeded to load adapter "OneBot V11"
10-13 18:47:53 [ERROR] nonebot | Failed to import "nonebot_plugin_fg"
Traceback (most recent call last):
File "", line 1, in
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/multiprocessing/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/multiprocessing/spawn.py", line 129, in _main
return self._bootstrap(parent_sentinel)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/uvicorn/_subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/uvicorn/server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/uvicorn/server.py", line 67, in serve
config.load()
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/uvicorn/config.py", line 479, in load
self.loaded_app = import_from_string(self.app)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/uvicorn/importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/Users/justin/QQbot/uuz/./bot.py", line 22, in
nonebot.load_plugin('nonebot_plugin_fg')
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/load.py", line 34, in load_plugin
return manager.load_plugin(module_path)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 141, in load_plugin
module = importlib.import_module(name)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot_plugin_fg/init.py", line 25, in
from .core import *
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot_plugin_fg/core.py", line 28, in
from .base import get_config_list, get_scheduler, get_sys_config
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot_plugin_fg/base.py", line 29, in
import nonebot_plugin_apscheduler
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot_plugin_apscheduler/init.py", line 3, in
from nonebot import export, get_driver
ImportError: cannot import name 'export' from 'nonebot' (/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/init.py)
10-13 18:47:53 [SUCCESS] nonebot | Succeeded to import "echo"
10-13 18:47:53 [ERROR] nonebot | Failed to import "nonebot_plugin_mcstatus"
Traceback (most recent call last):
File "", line 1, in
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/multiprocessing/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/multiprocessing/spawn.py", line 129, in _main
return self._bootstrap(parent_sentinel)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/uvicorn/_subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/uvicorn/server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/uvicorn/server.py", line 67, in serve
config.load()
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/uvicorn/config.py", line 479, in load
self.loaded_app = import_from_string(self.app)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/uvicorn/importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/Users/justin/QQbot/uuz/./bot.py", line 27, in
nonebot.load_from_toml("pyproject.toml")
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/load.py", line 122, in load_from_toml
return load_all_plugins(plugins, plugin_dirs)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/load.py", line 59, in load_all_plugins
return manager.load_all_plugins()
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 168, in load_all_plugins
return set(
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 169, in
filter(None, (self.load_plugin(name) for name in self.available_plugins))
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 141, in load_plugin
module = importlib.import_module(name)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot_plugin_mcstatus/init.py", line 4, in
from mcstatus import MinecraftServer
ImportError: cannot import name 'MinecraftServer' from 'mcstatus' (/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/mcstatus/init.py)
10-13 18:47:54 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_status"
10-13 18:47:54 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_withdraw"
10-13 18:47:54 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_manager"
10-13 18:47:54 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_htmlrender"
10-13 18:47:54 [ERROR] nonebot | Failed to import "wolfram"
Traceback (most recent call last):
File "", line 1, in
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/multiprocessing/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/multiprocessing/spawn.py", line 129, in _main
return self._bootstrap(parent_sentinel)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/uvicorn/_subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/uvicorn/server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/uvicorn/server.py", line 67, in serve
config.load()
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/uvicorn/config.py", line 479, in load
self.loaded_app = import_from_string(self.app)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/uvicorn/importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/Users/justin/QQbot/uuz/./bot.py", line 27, in
nonebot.load_from_toml("pyproject.toml")
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/load.py", line 122, in load_from_toml
return load_all_plugins(plugins, plugin_dirs)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/load.py", line 59, in load_all_plugins
return manager.load_all_plugins()
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 168, in load_all_plugins
return set(
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 169, in
filter(None, (self.load_plugin(name) for name in self.available_plugins))
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 145, in load_plugin
module = importlib.import_module(
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "/Users/justin/QQbot/uuz/./uuz/plugins/wolfram/init.py", line 6, in
from .data_source import get_wolframalpha_simple, get_wolframalpha_text
File "/Users/justin/QQbot/uuz/./uuz/plugins/wolfram/data_source.py", line 4, in
import wolframalpha
ModuleNotFoundError: No module named 'wolframalpha'
10-13 18:47:55 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_imageutils"
10-13 18:48:03 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_petpet"
10-13 18:48:03 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_moegoe"
10-13 18:48:03 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_code"
10-13 18:48:03 [ERROR] nonebot | Failed to import "nonebot_plugin_autohelp"
Traceback (most recent call last):
File "", line 1, in
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/multiprocessing/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/multiprocessing/spawn.py", line 129, in _main
return self._bootstrap(parent_sentinel)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/uvicorn/_subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/uvicorn/server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/uvicorn/server.py", line 67, in serve
config.load()
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/uvicorn/config.py", line 479, in load
self.loaded_app = import_from_string(self.app)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/uvicorn/importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/Users/justin/QQbot/uuz/./bot.py", line 27, in
nonebot.load_from_toml("pyproject.toml")
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/load.py", line 122, in load_from_toml
return load_all_plugins(plugins, plugin_dirs)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/load.py", line 59, in load_all_plugins
return manager.load_all_plugins()
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 168, in load_all_plugins
return set(
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 169, in
filter(None, (self.load_plugin(name) for name in self.available_plugins))
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 141, in load_plugin
module = importlib.import_module(name)
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/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 "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot_plugin_autohelp/init.py", line 7, in
from .nonebot_plugin_autohelp import nonebot_plugin_autohelp
File "/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot_plugin_autohelp/nonebot_plugin_autohelp.py", line 19, in
from nonebot.params import State
ImportError: cannot import name 'State' from 'nonebot.params' (/Users/justin/opt/miniconda3/envs/bot/lib/python3.10/site-packages/nonebot/params.py)
10-13 18:48:03 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_help"
10-13 18:48:03 [SUCCESS] nonebot | Succeeded to import "tex"
10-13 18:48:03 [INFO] uvicorn | Started server process [15343]
10-13 18:48:03 [INFO] uvicorn | Waiting for application startup.
10-13 18:48:04 [INFO] nonebot_plugin_htmlrender | 使用 chromium 启动
10-13 18:48:06 [INFO] nonebot_plugin_htmlrender | Browser Started.
10-13 18:48:06 [INFO] nonebot_plugin_petpet | 正在检查资源文件...
10-13 18:48:06 [INFO] uvicorn | Application startup complete.
10-13 18:48:07 [INFO] uvicorn | ('127.0.0.1', 60286) - "WebSocket /onebot/v11/ws" [accepted]
10-13 18:48:07 [INFO] nonebot | OneBot V11 | Bot 985393579 connected
10-13 18:48:07 [INFO] websockets | connection open`
src/plugins/what/data_source.py
第65行
if fuzz.ratio(str(title).lower(), keyword.lower()) < 90:
由于get_jiki这个函数最开始用了quote函数对keyword进行编码
如果keyword是中文,则65行这里的匹配率为0,返回为空
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.