mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-16 04:35:42 +00:00
67394bf623
* 可通过命令上传添加指定角色图片,上传至 **resources/character-img/刻晴/upload** * 请将图像与命令一同发送,后续会支持at图像及命令后发送图像 部分功能的页面文案及功能优化
28 lines
845 B
JavaScript
28 lines
845 B
JavaScript
import fetch from "node-fetch";
|
||
import Data from "./enka-data.js";
|
||
|
||
let Enka = {
|
||
key: "enka",
|
||
cd: 5,
|
||
async request({ e, uid, avatar, config }) {
|
||
let profileApi = config.enkaApi || function ({ uid }) {
|
||
return `https://enka.shinshin.moe/u/${uid}/__data.json`
|
||
};
|
||
let api = profileApi({ uid, avatar });
|
||
|
||
let req = await fetch(api);
|
||
let data = await req.json();
|
||
if (!data.playerInfo) {
|
||
e.reply(`请求失败:${data.msg || "可能是面板服务并发过高,请稍后重试"}`);
|
||
return false;
|
||
}
|
||
let details = data.avatarInfoList;
|
||
if (!details || details.length === 0 || !details[0].propMap) {
|
||
e.reply(`请打开游戏内角色展柜的“显示详情”后,等待5分钟重新获取面板`);
|
||
return false;
|
||
}
|
||
return Data.getData(uid, data);
|
||
}
|
||
}
|
||
|
||
export default Enka; |