lgc-NB2Dev / nonebot-plugin-akinator

把网络天才 Akinator 搬进你的 Bot!
MIT License
22 stars 0 forks source link

插件加载报错 #1

Closed ElainaFanBoy closed 1 year ago

ElainaFanBoy commented 1 year ago

大佬好,插件加载报错是因为什么

04-15 14:28:06 [ERROR] nonebot | Failed to import "nonebot_plugin_akinator" Traceback (most recent call last): File "bot.py", line 26, in nonebot.load_plugins("src/plugins") File "C:\Users\Demo\AppData\Local\Programs\Python\Python38\lib\site-packages\nonebot\plugin\load.py", line 39, in load_plugins return manager.load_all_plugins() File "C:\Users\Demo\AppData\Local\Programs\Python\Python38\lib\site-packages\nonebot\plugin\manager.py", line 172, in load_all_plugins return set( File "C:\Users\Demo\AppData\Local\Programs\Python\Python38\lib\site-packages\nonebot\plugin\manager.py", line 173, in filter(None, (self.load_plugin(name) for name in self.available_plugins))

File "C:\Users\Demo\AppData\Local\Programs\Python\Python38\lib\site-packages\nonebot\plugin\manager.py", line 148, in load_plugin module = importlib.import_module( File "C:\Users\Demo\AppData\Local\Programs\Python\Python38\lib\importlib__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "C:\Users\Demo\AppData\Local\Programs\Python\Python38\lib\site-packages\nonebot\plugin\manager.py", line 237, in exec_module super().exec_module(module) File "", line 783, in exec_module File "", line 219, in _call_with_frames_removed File "D:\Desktop\0\software\IRONY-Bot-main\IRONY-Bot\src\plugins\nonebot_plugin_akinator__init.py", line 3, in from . import main as main File "D:\Desktop\0\software\IRONY-Bot-main\IRONY-Bot\src\plugins\nonebot_plugin_akinator\main__.py", line 19, in def get_group_id_and_user_id(event: MessageEvent) -> tuple[int, int]: TypeError: 'type' object is not subscriptable

lgc2333 commented 1 year ago

怎么他妈还有用py3.8的,服了

ElainaFanBoy commented 1 year ago

怎么他妈还有用py3.8的,服了

qaq,您的readme里徽标上写了python3.8+我就试了一下

NumberSir commented 1 year ago

怎么他妈还有用py3.8的,服了

image

lgc2333 commented 1 year ago

当时这个函数是 code whisperer 自动建议的,当时tab了一下没检查,我的错

我现在主用py3.10,这些小问题没检查出来,我的疏忽,抱歉