-
Notifications
You must be signed in to change notification settings - Fork 0
/
impact.js
134 lines (121 loc) · 3.45 KB
/
impact.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import plugin from '../../lib/plugins/plugin.js'
import fetch from 'node-fetch'
var work=1;//控制开启和关闭,1开启,0关闭,暂时不可用
var api="http://h.bvb.moe:13389/impart?";
export class impact extends plugin{
constructor(){
super({
/** 功能名称 */
name:'impact系统',
/** 功能描述 */
dsc: '多人在线淫趴系统',
/** https://oicqjs.github.io/oicq/#events */
event: 'message',
/** 优先级,数字越小等级越高 */
priority: 6000,
rule:[
{
/** 命令正则匹配 */
reg: "淫趴帮助", //匹配消息正则,命令正则
/** 执行方法 */
fnc: 'help'
},
{
reg: "^#?生成牛子$",
fnc: 'create'
},
{
reg: "^#?remake$",
fnc: 'remake'
},
{
reg: "^#?开导|打胶$",
fnc: 'ziwei'
},
{
reg: "^#?嗦牛子$",
fnc: 'suo'
},
{
reg: "^#?决斗$",
fnc: 'playerpk'
},
{
reg: "^#?查询精神状态$",
fnc: 'query'
},
]
}
)
}
async help(e){
await e.reply('1.生成牛子 2.remake 3.开导/打胶 4.嗦牛子@某人 5.决斗@某人 6.查询精神状态/查询精神状态@某人')
}
async create(e){
let url=api+"fun=create&qq_myself="+e.user_id+"&qqgroup_myself="+e.group_id
let res = await fetch(url).catch((err) => logger.error(err));
if(!res){
return await this.reply('接口请求失败,请联系群433567006')
}
res = await res.text()
await this.reply(`${res}`)
}
async remake(e){
let url=api+"fun=remake&qq_myself="+e.user_id+"&qqgroup_myself="+e.group_id
let res = await fetch(url).catch((err) => logger.error(err));
if(!res){
return await this.reply('接口请求失败,请联系群433567006')
}
res = await res.text()
await this.reply(`${res}`)
}
async ziwei(e){
let url=api+"fun=ziwei&qq_myself="+e.user_id
let res = await fetch(url).catch((err) => logger.error(err));
if(!res){
return await this.reply('接口请求失败,请联系群433567006')
}
res = await res.text()
await this.reply(`${res}`)
}
async suo(e){
let qq_pk = e.message.filter(item => item.type == 'at')?.map(item => item?.qq);
let url=api+"fun=suo&qq_myself="+e.user_id+"&qq_pk="+qq_pk;
let res = await fetch(url).catch((err) => logger.error(err));
if(!res){
return await this.reply('接口请求失败,请联系群433567006')
}
res = await res.text()
await this.reply(`${res}`)
}
async playerpk(e){
let qq_pk = e.message.filter(item => item.type == 'at')?.map(item => item?.qq);
let url=api+"fun=pk&qq_myself="+e.user_id+"&qq_pk="+qq_pk;
let res = await fetch(url).catch((err) => logger.error(err));
if(!res){
return await this.reply('接口请求失败,请联系群433567006')
}
res = await res.text()
await this.reply(`${res}`)
}
async query(e){
let qq = e.message.filter(item => item.type == 'at')?.map(item => item?.qq);
if(qq==""){
let url=api+"fun=query&qq_myself="+e.user_id;
let res = await fetch(url).catch((err) => logger.error(err));
if(!res){
return await this.reply('接口请求失败,请联系群433567006')
}
res = await res.text()
await this.reply(`${res}`)
}else{
let url=api+"fun=query&qq_myself="+qq;
let res = await fetch(url).catch((err) => logger.error(err));
if(!res){
return await this.reply('接口请求失败,请联系群433567006')
}
res = await res.text()
await this.reply(`${res}`)
}
}
}