2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-23 03:20:52 +08:00

部分部分别名导致无法显示七圣召唤图片问题

This commit is contained in:
Ctrlcvs 2022-12-15 00:02:53 +08:00
parent 4eb6f8bb01
commit 16d9f7d19c

View File

@ -16,6 +16,7 @@ const list = ["wuqi_tujian", "shiwu_tujian", "yuanmo_tujian", "mijin_tujian", "s
const reglist = ["(#|专武|武器|图鉴)", "(#|食物|特殊料理|特色|料理|食材|图鉴)", "(#|原魔|怪物|图鉴|信息)", "(#|秘境|信息|图鉴)", "(#|圣遗物|图鉴|本|套)", const reglist = ["(#|专武|武器|图鉴)", "(#|食物|特殊料理|特色|料理|食材|图鉴)", "(#|原魔|怪物|图鉴|信息)", "(#|秘境|信息|图鉴)", "(#|圣遗物|图鉴|本|套)",
"(#|图鉴|道具)" "(#|图鉴|道具)"
] ]
let pathPlus = `${_path}/plugins/xiaoyao-cvs-plugin/resources/xiaoyao-plus/`
export async function AtlasAlias(e) { export async function AtlasAlias(e) {
if (!Cfg.get("Atlas.all")) { if (!Cfg.get("Atlas.all")) {
return false; return false;
@ -52,11 +53,15 @@ export async function roleInfo(e) {
name = msg; name = msg;
} else { } else {
name = Botcfg.roleIdToName(id, true); name = Botcfg.roleIdToName(id, true);
if (!name) return false;
} }
if(/原牌|七圣/.test(e.msg)) { if(/原牌|七圣/.test(e.msg)) {
if(!name){
let list = gsCfg.getfileYaml(`${_path}/plugins/xiaoyao-cvs-plugin/resources/Atlas_alias/`,'yuanmo_tujian')
name= info_img(e,list,msg)
}
type=`basicInfo_tujian/role/${name}` type=`basicInfo_tujian/role/${name}`
} }
if (!name) return false;
send_Msg(e, type, name) send_Msg(e, type, name)
return true; return true;
} }
@ -71,7 +76,7 @@ const filePath = async function(e) {
}else { }else {
msg=e.msg.replace(/#||信息|图鉴|命座|天赋/g, ""); msg=e.msg.replace(/#||信息|图鉴|命座|天赋/g, "");
} }
let path = `${_path}/plugins/xiaoyao-cvs-plugin/resources/xiaoyao-plus/${val}/${msg}.png` let path = `${pathPlus}${val}/${msg}.png`
if (fs.existsSync(path)) { if (fs.existsSync(path)) {
e.reply(segment.image(`file:///${path}`)); e.reply(segment.image(`file:///${path}`));
return true; return true;
@ -94,7 +99,7 @@ const send_Msg = function(e, type, name) {
} }
} }
} }
path = `${_path}/plugins/xiaoyao-cvs-plugin/resources/xiaoyao-plus/${type}/${name}.png` path = `${pathPlus}${type}/${name}.png`
if (!fs.existsSync(path)) { if (!fs.existsSync(path)) {
return false; return false;
} }