diff --git a/apps/stat.js b/apps/stat.js index 9da3f98d..23dd6df0 100644 --- a/apps/stat.js +++ b/apps/stat.js @@ -15,12 +15,11 @@ export async function consStat(e, { render }) { let consData = await HutaoApi.getCons(); if (!consData) { - e.reply("暂时无法查询"); + e.reply("角色持有数据获取失败,请稍后重试~"); return true; } - let msg = e.msg; let mode = /持有/.test(msg) ? "char" : "cons"; @@ -95,7 +94,7 @@ export async function abyssPct(e, { render }) { let abyssData = await HutaoApi.getAbyssPct(); if (!abyssData) { - e.reply("暂时无法查询"); + e.reply("深渊出场数据获取失败,请稍后重试~"); return true; } @@ -207,13 +206,13 @@ export async function abyssTeam(e, { render }) { let abyssData = await HutaoApi.getAbyssTeam(); if (!abyssData || !abyssData.data) { - e.reply("暂时无法查询"); + e.reply("深渊组队数据获取失败,请稍后重试~"); return true; } abyssData = abyssData.data; let talentData = await getTalentData(e); if (!talentData || talentData.length === 0) { - e.reply("暂时无法获得角色信息"); + e.reply("暂时未能获得角色的练度信息,请使用【#练度统计】命令尝试手工获取..."); return true; } diff --git a/components/Data.js b/components/Data.js index 10992e7d..00d51294 100644 --- a/components/Data.js +++ b/components/Data.js @@ -167,6 +167,10 @@ let Data = { await Data.asyncPool(10, fileList, cacheFn); return ret; + }, + + sleep(ms) { + return new Promise((resolve) => setTimeout(resolve, ms)); } diff --git a/components/Profile.js b/components/Profile.js index 46e9e421..e79ff55f 100644 --- a/components/Profile.js +++ b/components/Profile.js @@ -87,6 +87,10 @@ let posIdx = { } }; +function sleep(ms) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + let Data = { getData(uid, data) { let ret = { @@ -249,6 +253,9 @@ let Profile = { } await redis.set(`miao:role-all:${uid}`, 'loading', { EX: 20 }); e.reply("开始获取数据,可能会需要一定时间~"); + + await sleep(1000); + let api = `${cfg.api}?uid=${uid}&qq=${cfg.qq}&token=${cfg.token}`; if (e.avatar) { api += `&avatar=${e.avatar}`; diff --git a/components/models/Character.js b/components/models/Character.js index cdae3759..26569766 100644 --- a/components/models/Character.js +++ b/components/models/Character.js @@ -144,7 +144,7 @@ Character.getRandomImg = function (type) { let charPosIdx = { - 1: '宵宫,雷神,胡桃,甘雨,优菈,一斗,绫人,魈,可莉,迪卢克,凝光,刻晴,辛焱,烟绯,雷泽', + 1: '宵宫,雷神,胡桃,甘雨,优菈,一斗,公子,绫人,魈,可莉,迪卢克,凝光,刻晴,辛焱,烟绯,雷泽', 2: '夜兰,八重,九条,行秋,香菱,安柏,凯亚,丽莎,北斗,菲谢尔,重云,罗莎莉亚,埃洛伊', 3: '申鹤,莫娜,早柚,云堇,久岐忍,五郎,砂糖,万叶,温迪', 4: '班尼特,心海,琴,芭芭拉,七七,迪奥娜,托马,空,荧,阿贝多,钟离' diff --git a/index.js b/index.js index 7aae861c..254d6b89 100644 --- a/index.js +++ b/index.js @@ -38,8 +38,8 @@ export { let rule = { character: { - //reg: "^#(喵喵)?(更新)?(.*)(详情|详细|面板|面版|伤害[1-7]?)?(更新)?$", - reg: "noCheck", + reg: "^#(喵喵)?(更新)?(.*)(详情|详细|面板|面版|伤害[1-7]?)?(更新)?$", + //reg: "noCheck", describe: "【#角色】角色详情", }, getArtis: { diff --git a/resources/meta/character/刻晴/calc.js b/resources/meta/character/刻晴/calc.js new file mode 100644 index 00000000..09dd0b16 --- /dev/null +++ b/resources/meta/character/刻晴/calc.js @@ -0,0 +1,20 @@ +export const details = [{ + title: "E后重击伤害", + dmg: ({ talent }, dmg) => dmg(talent.a['重击伤害'], 'a2') +}, { + title: "Q单段伤害", + dmg: ({ talent }, dmg) => dmg(talent.q['连斩伤害2'][0], 'q') +}, { + title: "Q总伤害", + params: { q: 1 }, + dmg: ({ talent }, dmg) => dmg(talent.q['技能伤害'] + talent.q['连斩伤害'] + talent.q['最后一击伤害'], 'q') +}]; + +export const mainAttr = "atk,cpct,cdmg"; + +export const buffs = [{ + title: "刻晴6命:4层获得24%雷伤加成", + data: { + dmg: 24 + } +}]