Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMasterNotifyPlugin.php
More file actions
Latest commit
54 lines (47 loc) · 1.97 KB
/
Copy pathMasterNotifyPlugin.php
File metadata and controls
54 lines (47 loc) · 1.97 KB
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
<?php
namespacekjBotModule\kj415j45\CoreModule;
usekjBot\SDK\CoolQ;
usekjBot\Framework\Plugin;
usekjBot\Framework\Event\FriendRequestEvent;
usekjBot\Framework\Event\InvitedToGroupEvent;
usekjBot\Framework\Event\GroupDecreaseEvent;
class MasterNotifyPlugin extends Plugin{
public$handleDepth = 3;
publicfunctionnotice_group_decrease_kick_me(GroupDecreaseEvent$event){
returnnotifyMaster("{$event->operatorId} 将我从群 {$event->groupId} 踢出");
}
constcq_request_friend = true;
publicfunctioncoolq_request_friend(FriendRequestEvent$event, CoolQ$cq){
$uid = $event->getId();
$comment = $event->comment;
$flag = $event->getFlag();
if(Config('AllowFriends', false)){
try{
$event->accept($cq);
}catch(\Exception$e){
_log('ERROR', export($e));
returnnotifyMaster("自动添加 {$uid} 为好友失败,备注信息为“{$comment}”。flag为\n{$flag}");
}
returnnotifyMaster("已自动添加 {$uid} 为好友,备注信息为“{$comment}”");
}else{
returnnotifyMaster("{$uid} 请求添加好友,备注信息为“{$comment}”。flag为\n{$flag}");
}
}
constcq_request_group_invite = true;
publicfunctioncoolq_request_group_invite(InvitedToGroupEvent$event, CoolQ$cq){
$uid = $event->getId();
$gid = $event->groupId;
$flag = $event->getFlag();
if(Config('AllowGroups', false)){
try{
$event->accept($cq);
}catch(\Exception$e){
_log('ERROR', export($e));
returnnotifyMaster("自动接受 {$uid} 邀请到群 {$gid} 的请求失败。flag为\n{$flag}");
}
returnnotifyMaster("已自动接受 {$uid} 邀请到群 {$gid} 的请求");
}else{
returnnotifyMaster("{$uid} 请求添加到群 {$gid},flag为\n{$flag}");
}
}
}