sonderxiaoming / huannai_plugin_fortune Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
刚安装完的时候启动有报错,看以前的issues加了:path 没报错了 fortune_path: Path
但是插件没法用
pydantic.errors.PydanticUserError: A non-annotated attribute was detected: fortune_path = WindowsPath('C:/新建文件夹/HoshinoBot-master/hoshino/modules/huannai_plugin_fortune/resource')
. All model fields require a type annotation; if fortune_path
is not meant to be a field, you may be able to resolve this error by annotating it as a ClassVar
or updating model_config['ignored_types']
.
ERROR: Failed to import "hoshino.modules.huannai_plugin_fortune.config", error: A non-annotated attribute was detected: fortune_path = WindowsPath('C:/新建文件夹/HoshinoBot-master/hoshino/modules/huannai_plugin_fortune/resource')
. All model fields require a type annotation; if fortune_path
is not meant to be a field, you may be able to resolve this error by annotating it as a ClassVar
or updating model_config['ignored_types']
.
具体报错信息,是不是需要注释什么?
这是我复制的报错日志,请大神看一下
log.txt
请问遇到这个错误如何消除,后台显示了这个报错信息
将原来的extra_config_utils.py,改成以下的,
`from typing import List
def group_rule_str2list(rulestr: str) -> List[str]:
if rulestr[-1] == ',':
rulestr = rulestr[:-1]
return rulestr.split(",")
def group_rule_list2str(group_rule_list: List[str]) -> str:
gs = ""
for gr in group_rule_list:
gs = gs + gr + ","
gs = gs[:-1]
return gs
`
[2022-12-14 13:28:57] [WARNING]: 转换CQ码 ({"type": "image", "data": {"file": "file:////root/xcwbot/HoshinoBot/hoshino/modules/huannai_plugin_fortune/resource/out/965016498_385321933.png"}}) 到MiraiGo Element时出现错误: file not found 将忽略本段CQ码.
这里是go-cqhttp和hoshinobot不在同一台服务器,所以图片发不出去
extra_config_utils.py 中的两个list[str]导致报错,删掉下标后正常
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.