mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-16 04:35:42 +00:00
* #角色面板
功能升级
* 优化无角色面板数据时的引导 * 优化返回的图像格式及分辨率,平衡响应速度及显示效果 * 添加 `#胡桃面板更新` 命令,获取单个角色面板数据,每天可更新5次 * 更改 `#全部面板更新` 命令,获取角色展柜全部8个角色,每天可更新3次
This commit is contained in:
parent
8de28631a1
commit
3597ac5277
@ -1,7 +1,13 @@
|
|||||||
# 1.2.1
|
# 1.2.2
|
||||||
|
|
||||||
* `#角色面板` 增加伤害计算功能
|
* `#角色面板` 增加伤害计算功能
|
||||||
* 目前支持角色:雷神、胡桃、魈、神子、甘雨、宵宫、公子
|
* 目前支持角色:雷神、胡桃、魈、神子、甘雨、宵宫、公子
|
||||||
|
* `#角色面板` 功能升级
|
||||||
|
* 优化无角色面板数据时的引导
|
||||||
|
* 优化返回的图像格式及分辨率,平衡响应速度及显示效果
|
||||||
|
* 添加 `#胡桃面板更新` 命令,获取单个角色面板数据,每天可更新5次
|
||||||
|
* 更改 `#全部面板更新` 命令,获取角色展柜全部8个角色,每天可更新3次
|
||||||
|
|
||||||
|
|
||||||
# 1.2.0
|
# 1.2.0
|
||||||
|
|
||||||
|
@ -65,16 +65,24 @@ export async function character(e, { render, User }) {
|
|||||||
let mode = 'card';
|
let mode = 'card';
|
||||||
if (/(详情|详细|面板|面版)$/.test(msg)) {
|
if (/(详情|详细|面板|面版)$/.test(msg)) {
|
||||||
mode = 'profile';
|
mode = 'profile';
|
||||||
|
} else if (/(详情|详细|面板|面版)更新$/.test(msg)) {
|
||||||
|
mode = "refresh";
|
||||||
}
|
}
|
||||||
|
|
||||||
let name = msg.replace(/#|老婆|老公|详情|详细|面板|面版|[1|2|5][0-9]{8}/g, "").trim();
|
let name = msg.replace(/#|老婆|老公|详情|详细|面板|面版|更新|[1|2|5][0-9]{8}/g, "").trim();
|
||||||
let char = Character.get(name);
|
let char = Character.get(name);
|
||||||
|
|
||||||
if (!char) {
|
if (!char) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (mode === "profile") {
|
if (mode === "profile") {
|
||||||
return renderProfile(e, char, render);
|
return renderProfile(e, char, render);
|
||||||
|
} else if (mode === "refresh") {
|
||||||
|
e.avatar = char.id;
|
||||||
|
await getProfile(e);
|
||||||
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return renderAvatar(e, char.name, render);
|
return renderAvatar(e, char.name, render);
|
||||||
}
|
}
|
||||||
@ -563,13 +571,17 @@ export async function renderProfile(e, char, render) {
|
|||||||
cookieType: "self",
|
cookieType: "self",
|
||||||
actionName: "查询角色天赋命座等信息"
|
actionName: "查询角色天赋命座等信息"
|
||||||
});
|
});
|
||||||
|
if (!MysApi) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
let selfUser = e.selfUser,
|
let selfUser = e.selfUser,
|
||||||
uid = selfUser.uid;
|
uid = selfUser.uid;
|
||||||
|
|
||||||
let profile = Profile.get(uid, char.id);
|
let profile = Profile.get(uid, char.id);
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
e.reply(`请先发送 #获取游戏角色详情 命令获取 ${char.name} 的面板详情。\n请确认已将需要获取的8位角色展示在【游戏内】的“角色展柜”中,并已打开“显示角色详情”。如刚进行设置请等待5分钟后再进行使用,以免浪费请求次数。 `)
|
e.reply(`请先发送 #${char.name}面板更新\n来获取${char.name}的面板详情`);
|
||||||
|
e.reply(segment.image(`file://${process.cwd()}/plugins/miao-plugin/resources/character/imgs/help.jpg`))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,8 +248,11 @@ let Profile = {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
await redis.set(`miao:role-all:${uid}`, 'loading', { EX: 20 });
|
await redis.set(`miao:role-all:${uid}`, 'loading', { EX: 20 });
|
||||||
e.reply("开始获取角色展柜中展示的角色详情,数据获取可能会需要一定时间~");
|
e.reply("开始获取数据,可能会需要一定时间~");
|
||||||
const api = `${cfg.api}?uid=${uid}&qq=${cfg.qq}&token=${cfg.token}`;
|
let api = `${cfg.api}?uid=${uid}&qq=${cfg.qq}&token=${cfg.token}`;
|
||||||
|
if (e.avatar) {
|
||||||
|
api += `&avatar=${e.avatar}`;
|
||||||
|
}
|
||||||
let req = await fetch(api);
|
let req = await fetch(api);
|
||||||
let data = await req.json();
|
let data = await req.json();
|
||||||
if (data.status !== 0 || !data.data) {
|
if (data.status !== 0 || !data.data) {
|
||||||
|
4
index.js
4
index.js
@ -25,7 +25,7 @@ export {
|
|||||||
|
|
||||||
let rule = {
|
let rule = {
|
||||||
character: {
|
character: {
|
||||||
reg: "^#(喵喵)?(.*)(详情|详细|面板|面版)?$",
|
reg: "^#(喵喵)?(.*)(详情|详细|面板|面版)?(更新)?$",
|
||||||
describe: "【#角色】角色详情",
|
describe: "【#角色】角色详情",
|
||||||
},
|
},
|
||||||
wife: {
|
wife: {
|
||||||
@ -49,7 +49,7 @@ let rule = {
|
|||||||
describe: "【#帮助】 #喵喵帮助",
|
describe: "【#帮助】 #喵喵帮助",
|
||||||
},
|
},
|
||||||
getProfile: {
|
getProfile: {
|
||||||
reg: "^#(获取|更新)(游戏|角色)*(详情|详细|面板|面版)$",
|
reg: "^#(全部面板更新|获取游戏角色详情)$",
|
||||||
describe: "【#角色】 获取游戏橱窗详情数据",
|
describe: "【#角色】 获取游戏橱窗详情数据",
|
||||||
},
|
},
|
||||||
enemyLv: {
|
enemyLv: {
|
||||||
|
BIN
resources/character/imgs/help.jpg
Normal file
BIN
resources/character/imgs/help.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 216 KiB |
Loading…
Reference in New Issue
Block a user