-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path寻找主人.js
31 lines (31 loc) · 1.17 KB
/
寻找主人.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
import Cfg from '../../lib/config/config.js';
export class find_Master extends plugin {
constructor() {
super({
name: '找主人',
dsc: '帮走丢的机器人找到回家的路',
event: 'message',
priority: -1000,
rule: [
{
reg: '^#?你主人是谁$',
fnc: 'like'
}
]
})
}
async like(e) {
const msg = []
msg.push(`我的主人是`)
for(let master of Cfg.masterQQ)
switch (e?.adapter){
case 'WeXin':
case 'ComWeChat': if(typeof master == "string" && master.match(/^wxid_/)) msg.push(segment.at(master)); break;
case 'QQGuild': if(typeof master == "string" && master.match(/^qg_/)) msg.push(segment.at(master)); break;
case 'QQBot': if(typeof master == "string" && master.match(`${e.self_id}-`)) msg.push(segment.at(master)); break;
default: if(typeof master == "number") msg.push(segment.at(+master)); break;
}
await this.reply(msg)
return;
}
}