foxwhite25 / rpgthingy

GNU General Public License v3.0
16 stars 1 forks source link

指令使用报错 #1

Closed wq1211660662 closed 3 years ago

wq1211660662 commented 3 years ago

[2021-02-23 17:24:43,118 nonebot] INFO: Self: 2476348678, Message -260249734 from 2379245215@[群:794583456]: '?创建角色 123' [2021-02-23 17:24:43,118 random_idle] INFO: Message -260249734 triggered exec_cmd by PrefixTrigger. [2021-02-23 17:24:43,118 random_idle] ERROR: <class 'sqlite3.OperationalError'> occured when exec_cmd handling message -260249734. [2021-02-23 17:24:43,134 random_idle] ERROR: table inventory has no column named charge Traceback (most recent call last): File "C:\HoshinoBot\hoshino\msghandler.py", line 28, in handle_message await sf.func(bot, event) File "C:\HoshinoBot\hoshino\modules\rpgthingy\lib.py", line 31, in exec_cmd await func(bot, ev, args) File "C:\HoshinoBot\hoshino\modules\rpgthingy\main.py", line 284, in cmd_create db.ini_player(uid, name) File "C:\HoshinoBot\hoshino\modules\rpgthingy\lib.py", line 298, in ini_player conn.execute( sqlite3.OperationalError: table inventory has no column named charge

[2021-02-23 17:55:17,825 random_idle] INFO: Message 1771179757 triggered exec_cmd by PrefixTrigger. [2021-02-23 17:55:18,027 random_idle] ERROR: <class 'IndexError'> occured when exec_cmd handling message 1771179757. [2021-02-23 17:55:18,028 random_idle] ERROR: list index out of range Traceback (most recent call last): File "C:\no1\HoshinoBot\hoshino\msghandler.py", line 28, in handle_message await sf.func(bot, event) File "C:\no1\HoshinoBot\hoshino\modules\rpgthingy\lib.py", line 32, in exec_cmd await func(bot, ev, args) File "C:\no1\HoshinoBot\hoshino\modules\rpgthingy\main.py", line 24, in cmd_test msg = crafting(uid) File "C:\no1\HoshinoBot\hoshino\modules\rpgthingy\ma.py", line 662, in crafting mastery = db.get_mastery(uid, 'crafting')[0] File "C:\no1\HoshinoBot\hoshino\modules\rpgthingy\lib.py", line 232, in get_mastery return r[0] IndexError: list index out of range [2021-02-23 17:55:18,028 nonebot] INFO: Message 1771179757 is ignored

还有test.py里面的from lib import 这里有点问题 以及lib.py里面加入from .ma import 过后就会 [2021-02-23 17:36:30,181 nonebot] ERROR: Failed to import "hoshino.modules.rpgthingy.lib", error: name 'RecordDAO' is not defined [2021-02-23 17:36:30,181 nonebot] ERROR: name 'RecordDAO' is not defined Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\nonebot\plugin.py", line 249, in load_plugin module = importlib.import_module(module_path) File "C:\Users\Administrator\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 "", line 783, in exec_module File "", line 219, in _call_with_frames_removed File "C:\HoshinoBot\hoshino\modules\rpgthingy\lib.py", line 7, in from .ma import * File "C:\HoshinoBot\hoshino\modules\rpgthingy\ma.py", line 18, in db = RecordDAO(RPG_DB_PATH) NameError: name 'RecordDAO' is not defined

大佬能解决一下就好了,谢谢

foxwhite25 commented 3 years ago

test.py是我测试用的,如果不需要删了就行,对于功能没有任何影响 能不能截图/~/.hoshino目录看一下

foxwhite25 commented 3 years ago

https://github.com/foxwhite25/rpgthingy/releases/tag/a.0.1.1 在最新commit修复了,阅读hotfix的简介。