2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-23 03:20:52 +08:00

修正体力模板列表显示上限问题

This commit is contained in:
Ctrlcsv 2022-08-04 00:15:34 +08:00 committed by leiyilu
parent b2518cc358
commit 9421bc4efb
2 changed files with 20 additions and 2 deletions

View File

@ -384,8 +384,12 @@ export async function Note_appoint(e) {
nickname = info.card || info.nickname nickname = info.card || info.nickname
} }
if (msg.includes("列表")) { if (msg.includes("列表")) {
let xlmsg=msg.replace("列表","") || 1
let mstList = []; let mstList = [];
urlType.unshift(`请选择序号~~\n当前支持选择的模板有:`) let sumCount=(urlType.length/98).toFixed(0);
xlmsg=sumCount-xlmsg>-1?xlmsg:sumCount;
urlType.unshift(`模板列表共,第${xlmsg+1}页,共${urlType.length}张,请选择序号~~\n当前支持选择的模板有:`)
let count=0;
for (let [index, item] of urlType.entries()) { for (let [index, item] of urlType.entries()) {
let msg_pass = []; let msg_pass = [];
let imgurl; let imgurl;
@ -400,6 +404,12 @@ export async function Note_appoint(e) {
} }
item = index + "." + item item = index + "." + item
} }
if(msg_pass.length==98){
break;
}
if(index<98*(xlmsg-1)){
continue;
}
msg_pass.push(item) msg_pass.push(item)
if (imgurl) { if (imgurl) {
msg_pass.push(imgurl) msg_pass.push(imgurl)
@ -410,6 +420,14 @@ export async function Note_appoint(e) {
user_id: Bot.uin user_id: Bot.uin
}) })
} }
if(xlmsg*98<urlType.length-1){
mstList.push({
message: `更多内容请翻页查看\n如:#体力模板列表2`,
nickname: nickname,
user_id: Bot.uin
})
}
e.reply(await Bot.makeForwardMsg(mstList)); e.reply(await Bot.makeForwardMsg(mstList));
return true; return true;
} }

View File

@ -70,7 +70,7 @@ let rule = {
describe: "体力", describe: "体力",
}, },
Note_appoint: { Note_appoint: {
reg: "^#体力模板(设置(.*)|列表)$", reg: "^#体力模板(设置(.*)|列表(.*))$",
describe: "体力模板设置", describe: "体力模板设置",
}, },
pokeNote: { pokeNote: {