miao-plugin/components/profile-data/enka.js
yoimiya-kokomi 89769be51a 增加扩散、感电的计算逻辑,感谢 **@49631073**的逻辑梳理
伤害计算增加 万叶ⁿᵉʷ、久岐忍ⁿᵉʷ,温迪增加扩散伤害计算
部分角色评分权重微调
2022-06-21 06:55:08 +08:00

33 lines
913 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import fetch from "node-fetch";
import Data from "./enka-data.js";
let Enka = {
key: "enka",
cd: 5,
async request({ e, uid, config }) {
let profileApi = config.profileApi || function (uid) {
return `https://enka.shinshin.moe/u/${uid}/__data.json`
};
let api = profileApi(uid);
let req = await fetch(api);
let data = await req.json();
if (!data.playerInfo) {
if ((uid + '')[0] === '5') {
e.reply(`请求失败:暂时不支持B服角色面板更新请等待服务后续升级`);
} else {
e.reply(`请求失败:${data.msg || "请求错误,请稍后重试"}`);
}
return false;
}
let details = data.avatarInfoList;
if (!details || details.length === 0 || !details[0].propMap) {
e.reply(`请打开角色展柜的显示详情`);
return false;
}
return Data.getData(uid, data);
}
}
export default Enka;