-
Notifications
You must be signed in to change notification settings - Fork 0
/
wallpaper.js
79 lines (60 loc) · 1.95 KB
/
wallpaper.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import { segment } from "oicq";
import fetch from "node-fetch";
const _path = process.cwd();
export class wallpaper extends plugin {
constructor () {
super({
name: 'wallpaper',
dsc: '壁纸',
event: 'message',
priority: 500,
rule: [
{
reg: "^#?(手机壁纸|pe壁纸)$",
fnc: 'pe'
},
{
reg: "^#?(电脑壁纸|pc壁纸)$",
fnc: 'pc'
},
{
reg: "^#?(风景|二次元风景)$",
fnc: 'scenery'
},
]
})
}
async pe(e) {
//e.msg 用户的命令消息
console.log("用户命令:", e.msg);
//执行的逻辑功能
let url = `https://api.ghser.com/random/pe.php`;
let res = await fetch(url).catch((err) => logger.error(err));
let msg = [segment.at(e.user_id), segment.image(res.url)];
//发送消息
e.reply(msg);
return true; //返回true 阻挡消息不再往下
}
async pc(e) {
//e.msg 用户的命令消息
console.log("用户命令:", e.msg);
//执行的逻辑功能
let url = `https://api.ghser.com/random/pc.php`;
let res = await fetch(url).catch((err) => logger.error(err));
let msg = [segment.at(e.user_id), segment.image(res.url)];
//发送消息
e.reply(msg);
return true; //返回true 阻挡消息不再往下
}
async scenery(e) {
//e.msg 用户的命令消息
console.log("用户命令:", e.msg);
//执行的逻辑功能
let url = `https://api.ghser.com/random/bg.php`;
let res = await fetch(url).catch((err) => logger.error(err));
let msg = [segment.at(e.user_id), segment.image(res.url)];
//发送消息
e.reply(msg);
return true; //返回true 阻挡消息不再往下
}
}