From 736b9cdcb698ca714188faec53e2c0889460013a Mon Sep 17 00:00:00 2001 From: Ctrlcvs <1509167646@qq.com> Date: Wed, 28 Dec 2022 21:18:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=83=E5=9C=A3=E5=8F=AC?= =?UTF-8?q?=E5=94=A4=E6=AD=A6=E5=99=A8=E6=95=B0=E6=8D=AE=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/xiaoyao_image.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/apps/xiaoyao_image.js b/apps/xiaoyao_image.js index 8ccd050..dfb475d 100644 --- a/apps/xiaoyao_image.js +++ b/apps/xiaoyao_image.js @@ -30,10 +30,23 @@ export async function AtlasAlias(e) { } if (await Atlas_list(e)) return true; if (await roleInfo(e)) return true; + if (await getBasicEvent(e)) return true; if (await filePath(e)) return true; return send_Msg(e, "all", ""); } +async function getBasicEvent(e){ + if(!/原牌|七圣召唤|七圣|动态|幻影/.test(e.msg)) return false; //为了避免抢夺其他指令 + let msg = e.msg.replace(/#|#|信息|图鉴|原牌|七圣召唤|七圣|动态|幻影/g, ""); + let name,type; + if (!name) { + let list = gsCfg.getfileYaml(`${_path}/plugins/xiaoyao-cvs-plugin/resources/Atlas_alias/`, 'wuqi_tujian') + name = info_img(e, list, msg) + } + type = `basicInfo_tujian/event` + send_Msg(e, type, name) + return true; +} /** 获取角色卡片的原图 */ export async function getBasicVoide(e) { @@ -74,7 +87,7 @@ export async function getBasicVoide(e) { return true } export async function roleInfo(e) { - let msg = e.msg.replace(/#|#|信息|图鉴|命座|天赋|原牌|七圣|动态|幻影|七圣召唤/g, ""); + let msg = e.msg.replace(/#|#|信息|图鉴|命座|天赋|原牌|七圣召唤|七圣|动态|幻影/g, ""); let Botcfg, id, type = 'juese_tujian'; if (isV3) { Botcfg = (await import(`file://${_path}/plugins/genshin/model/gsCfg.js`)).default; @@ -139,6 +152,7 @@ const send_Msg = async function (e, type, name) { } } path = `${pathPlus}${type}/${name}.png` + if(/原牌|七圣召唤|七圣|动态|幻影/.test(e.msg)) path= path.replace(/\.png/,'.jpg') if (!fs.existsSync(path)) { return false; }