kexue-z / nonebot-plugin-setu-now

不可以涩涩
MIT License
128 stars 19 forks source link

插件启动报错 #59

Closed EmiyaGm closed 1 year ago

EmiyaGm commented 1 year ago
08-07 18:29:17 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_localstore"
08-07 18:29:17 [WARNING] nonebot_plugin_tortoise_orm | 没有设置数据库地址, 使用 sqlite:////Users/gongmin/Library/Application Support/nonebot2/db.sqlite3
08-07 18:29:17 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_tortoise_orm"
08-07 18:29:17 [ERROR] nonebot | Failed to import "nonebot_plugin_setu_now"
Traceback (most recent call last):
  File "<string>", line 14, in <module>
  File "/Users/gongmin/Documents/code/emiyagm-bot/.venv/lib/python3.9/site-packages/nonebot/plugin/load.py", line 125, in load_from_toml
    return load_all_plugins(plugins, plugin_dirs)
  File "/Users/gongmin/Documents/code/emiyagm-bot/.venv/lib/python3.9/site-packages/nonebot/plugin/load.py", line 62, in load_all_plugins
    return manager.load_all_plugins()
  File "/Users/gongmin/Documents/code/emiyagm-bot/.venv/lib/python3.9/site-packages/nonebot/plugin/manager.py", line 175, in load_all_plugins
    return set(
  File "/Users/gongmin/Documents/code/emiyagm-bot/.venv/lib/python3.9/site-packages/nonebot/plugin/manager.py", line 176, in <genexpr>
    filter(None, (self.load_plugin(name) for name in self.available_plugins))
> File "/Users/gongmin/Documents/code/emiyagm-bot/.venv/lib/python3.9/site-packages/nonebot/plugin/manager.py", line 141, in load_plugin
    module = importlib.import_module(name)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "/Users/gongmin/Documents/code/emiyagm-bot/.venv/lib/python3.9/site-packages/nonebot/plugin/manager.py", line 241, in exec_module
    super().exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/gongmin/Documents/code/emiyagm-bot/.venv/lib/python3.9/site-packages/nonebot_plugin_setu_now/__init__.py", line 41, in <module>
    from .r18_whitelist import get_group_white_list_record
  File "/Users/gongmin/Documents/code/emiyagm-bot/.venv/lib/python3.9/site-packages/nonebot_plugin_setu_now/r18_whitelist.py", line 12, in <module>
    ) -> GroupWhiteListRecord | None:
TypeError: unsupported operand type(s) for |: 'ModelMeta' and 'NoneType'

运行环境 osx

版本

image

nonebot2 2.0.0

没有填入任何配置项,只是单纯的 nb install plugin 装了上去

kexue-z commented 1 year ago

使用了 3.10 的语法,报错了。可以尝试升级

kexue-z commented 1 year ago

0.6.1 已经更新了,兼容了旧版的 typing