From 6f9697e264e0f97c0447095a8e9adb6c2a36cc21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E6=B5=B7=E9=87=8C=E7=9A=84=E7=A7=8B=E5=88=80?= =?UTF-8?q?=E9=B1=BC?= <11458387+Saury-loser@user.noreply.gitee.com> Date: Fri, 10 Feb 2023 13:47:31 +0000 Subject: [PATCH] update apps/yxysj.js. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 花海里的秋刀鱼 <11458387+Saury-loser@user.noreply.gitee.com> --- apps/yxysj.js | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/apps/yxysj.js b/apps/yxysj.js index fbe81ad..9637454 100644 --- a/apps/yxysj.js +++ b/apps/yxysj.js @@ -14,11 +14,11 @@ export class stplus extends plugin { priority: 3999,//优先级,数越小优先度越高 rule: [ { - reg: '^#云溪图$', + reg: '^#小冰图$', fnc: 'yunxi' }, { - reg: '^#(\\d+张)云溪图$', + reg: '^#(\\d+张)小冰图$', fnc: 'yxy' } ] @@ -42,13 +42,18 @@ export class stplus extends plugin { if (ismaster) { if(!e.isMaster) return false } - let url = `https://api.peterliangaaa.repl.co/yxy` - await e.reply('正在给你找云溪院的图片啦~',true,{recallMsg:7}) + let url = `https://xiaobapi.top/api/xb/api/pixiv_r18.php` + await e.reply('正在给你找小冰图的图片啦~',true,{recallMsg:7}) + let res = await fetch(url).catch(err => {}) + if (res?.ok) { + res = await res.json() + url = res.data[0].urls.original + } let image = [] let num = 1 let msg = segment.image(url) image.push(msg) - let abc = await e.reply(num = 1 ? await co.makeForwardMsg(e,image,'云溪图来啦') : image,false,{recallMsg:0});//私聊撤回间隔 + let abc = await e.reply(num == 1 ? await co.makeForwardMsg(e,image,'小冰图来啦') : image,false,{recallMsg:0});//私聊撤回间隔 if (!abc) return e.reply('好、好铯(//// ^ ////)……被、被吞啦o(≧口≦)o',true,{recallMsg:60}) return true @@ -74,19 +79,24 @@ export class stplus extends plugin { if(!e.isMaster) return false } - let url = `https://api.peterliangaaa.repl.co/yxy` - await e.reply('正在给你找云溪院的图片啦~',true,{recallMsg:7}) + await e.reply('正在给你找小冰图的图片啦~',true,{recallMsg:7}) let num = e.msg.match(/\d+/) if (num > shu) {num = shu;await e.reply('一次最多'+ shu +'张哦')}else {num = e.msg.match(/\d+/) } let image = [] for (let i = 0; i < [num]; i++) { + let url = `https://xiaobapi.top/api/xb/api/pixiv_r18.php` + let res = await fetch(url).catch(err => {}) + if (res?.ok) { + res = await res.json() + url = res.data[0].urls.original + } let msg = segment.image(url) image.push(msg) console.log('已获取图片链接 ' + (i + 1) + ' 个'); await common.sleep(500); } - let abc = await e.reply(num > 1 ? await co.makeForwardMsg(e,image,'云溪图来啦') : image,false,{recallMsg:0});//私聊撤回间隔 + let abc = await e.reply(num > 1 ? await co.makeForwardMsg(e,image,'小冰图来啦') : image,false,{recallMsg:0});//私聊撤回间隔 if (!abc) return e.reply('好、好铯(//// ^ ////)……被、被吞啦o(≧口≦)o',true,{recallMsg:60}) return true } -} \ No newline at end of file +} -- Gitee