代码拉取完成,页面将自动刷新
import fetch from "node-fetch";
import plugin from "../../lib/plugins/plugin.js";
import common from "../../lib/common/common.js";
let NumReg = '[一壹二两三四五六七八九十百千万亿\\d]+'
export class animal extends plugin {
constructor() {
super({
name: "壁纸",
dsc: "随机壁纸",
event: "message",
priority: 500,
rule: [
{
reg: "^#*来个帅哥$",
fnc: "husband"
},
{
reg: "^#*来个猫猫$",
fnc: "mao"
},
{
reg: "^#*情侣头像$",
fnc: "cptou"
},
{
reg: "^#*甘城猫猫(.*)$",
fnc: "kkk"
},
{
reg: "^#*(mc|MC)酱(.*)$",
fnc: "mc"
},
{
reg: "^#*小(c|C)酱(.*)$",
fnc: "xiaoc"
},
{
reg: "^#*原神(图片|壁纸)(.*)$",
fnc: "yuans"
},
{
reg: "^#*兽猫酱(.*)$",
fnc: "shou"
},
{
reg: "^#*滑稽表情包(.*)$",
fnc: "huaji"
},
{
reg: "^#*柴郡表情包(.*)$",
fnc: "chaijun"
},
{
reg: "^#*原神表情包(.*)$",
fnc: "yuan"
},
{
reg: "^#*天使来到我身边(.*)$",
fnc: "tianshi"
},
{
reg: "^#*每日早报$",
fnc: "kanshijie"
},
]
});
}
async husband(e) {
e.reply("加载中...")
let url = "https://xiaobai.klizi.cn/API/img/boy.php"
let response = await fetch(url);
let res = await response.text();
await e.reply(segment.image(`${res}`),true)
return true;
}
async mao(e) {
//e.msg 用户的命令消息
console.log("用户命令:", e.msg);
//执行的逻辑功能
e.reply("猫猫加载中...")
let url = `http://edgecats.net/`;
let res = await fetch(url);
let msg = [segment.image(res.url)];
//发送消息
e.reply(msg,true);
return true; //返回true 阻挡消息不再往下
}
async cptou(e) {
//e.msg 用户的命令消息
console.log("用户命令:", e.msg);
//执行的逻辑功能
let url = `https://xiaobai.klizi.cn/API/other/sweethearts.php`;
let response = await fetch(url);
let res = await response.json();
let msg = [
segment.image(res.url1),
segment.image(res.url2),
];
//发出消息
await e.reply(msg,true);
return true; //返回true 阻挡消息不再往下
}
async kkk(e) {
let num = e.msg.match(new RegExp(`(${NumReg})(张|份)`));
if (!num) {
num = 1;
} else {
num = Number(num[1]);
}
if (num>5) { e.reply("一次最多5张哦")
return;
}
let counter = 0;
while (counter < num ) {
let url = `https://xiaobapi.top/api/xb/api/gcmm.php`;
let res = await fetch(url)
//发出消息
await e.reply(segment.image(res.url),true);
counter++;
// 等待5秒再获取下一张图片
await new Promise(resolve => setTimeout(resolve, 1 * 1000));
}
return true; //返回true 阻挡消息不再往下
}
async mc(e) {
let num = e.msg.match(new RegExp(`(${NumReg})(张|份)`));
if (!num) {
num = 1;
} else {
num = Number(num[1]);
}
if (num>5) { e.reply("一次最多5张哦")
return;
}
let counter = 0;
while (counter < num ) {
let url = `http://api.caonm.net/api/mc/index.php`;
let res = await fetch(url)
//发出消息
await e.reply(segment.image(res.url),true);
counter++;
// 等待5秒再获取下一张图片
await new Promise(resolve => setTimeout(resolve, 1 * 1000));
}
return true; //返回true 阻挡消息不再往下
}
async yuans(e) {
let num = e.msg.match(new RegExp(`(${NumReg})(张|份)`));
if (!num) {
num = 1;
} else {
num = Number(num[1]);
}
if (num>5) { e.reply("一次最多5张哦")
return;
}
let counter = 0;
while (counter < num ) {
let url = `https://ovooa.caonm.net/API/yuan/?type=text`;
let res = await fetch(url)
res = await res.text()
//发出消息
await e.reply(segment.image(`${res}`),true);
counter++;
// 等待5秒再获取下一张图片
await new Promise(resolve => setTimeout(resolve, 1 * 1000));
}
return true; //返回true 阻挡消息不再往下
}
async xiaoc(e) {
let num = e.msg.match(new RegExp(`(${NumReg})(张|份)`));
if (!num) {
num = 1;
} else {
num = Number(num[1]);
}
if (num>5) { e.reply("一次最多5张哦")
return;
}
let counter = 0;
while (counter < num ) {
let url = `http://api.caonm.net/api/xc/index.php`;
let res = await fetch(url)
//发出消息
await e.reply(segment.image(res.url),true);
counter++;
// 等待5秒再获取下一张图片
await new Promise(resolve => setTimeout(resolve, 1 * 1000));
}
return true; //返回true 阻挡消息不再往下
}
async shou(e) {
let num = e.msg.match(new RegExp(`(${NumReg})(张|份)`));
if (!num) {
num = 1;
} else {
num = Number(num[1]);
}
if (num>5) { e.reply("一次最多5张哦")
return;
}
let counter = 0;
while (counter < num ) {
let url = `http://api.caonm.net/api/smj/index.php`;
let res = await fetch(url)
//发出消息
await e.reply(segment.image(res.url),true);
counter++;
// 等待5秒再获取下一张图片
await new Promise(resolve => setTimeout(resolve, 1 * 1000));
}
return true; //返回true 阻挡消息不再往下
}
async huaji(e) {
let num = e.msg.match(new RegExp(`(${NumReg})(张|份)`));
if (!num) {
num = 1;
} else {
num = Number(num[1]);
}
if (num>5) { e.reply("一次最多5张哦")
return;
}
let counter = 0;
while (counter < num ) {
let url = `http://api.caonm.net/api/huac/h.php?`;
let res = await fetch(url)
//发出消息
await e.reply(segment.image(res.url),true);
counter++;
// 等待5秒再获取下一张图片
await new Promise(resolve => setTimeout(resolve, 1 * 1000));
}
return true; //返回true 阻挡消息不再往下
}
async chaijun(e) {
let num = e.msg.match(new RegExp(`(${NumReg})(张|份)`));
if (!num) {
num = 1;
} else {
num = Number(num[1]);
}
if (num>5) { e.reply("一次最多5张哦")
return;
}
let counter = 0;
while (counter < num ) {
let url = `http://api.caonm.net/api/chai/c.php?`;
let res = await fetch(url)
//发出消息
await e.reply(segment.image(res.url),true);
counter++;
// 等待5秒再获取下一张图片
await new Promise(resolve => setTimeout(resolve, 1 * 1000));
}
return true; //返回true 阻挡消息不再往下
}
async yuan(e) {
let num = e.msg.match(new RegExp(`(${NumReg})(张|份)`));
if (!num) {
num = 1;
} else {
num = Number(num[1]);
}
if (num>5) { e.reply("一次最多5张哦")
return;
}
let counter = 0;
while (counter < num ) {
let url = `http://api.caonm.net/api/yuans/y.php?`;
let res = await fetch(url)
//发出消息
await e.reply(segment.image(res.url),true);
counter++;
// 等待5秒再获取下一张图片
await new Promise(resolve => setTimeout(resolve, 1 * 1000));
}
return true; //返回true 阻挡消息不再往下
}
async tianshi(e) {
let num = e.msg.match(new RegExp(`(${NumReg})(张|份)`));
if (!num) {
num = 1;
} else {
num = Number(num[1]);
}
if (num>5) { e.reply("一次最多5张哦")
return;
}
let counter = 0;
while (counter < num ) {
let url = `https://xiaobapi.top/api/xb/api/tp.php`;
let res = await fetch(url)
//发出消息
await e.reply(segment.image(res.url),true);
counter++;
// 等待5秒再获取下一张图片
await new Promise(resolve => setTimeout(resolve, 1 * 1000));
}
return true; //返回true 阻挡消息不再往下
}
async kanshijie(e) {
let url = `https://api.andeer.top/API/60s.php`;
let res = await fetch(url)
//发出消息
await e.reply(segment.image(res.url),true);
return true; //返回true 阻挡消息不再往下
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。