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:
Ctrlcvs 2022-08-04 09:37:00 +08:00 committed by leiyilu
parent 9421bc4efb
commit 972d78f042

View File

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