-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGroupManagePlugin.php
More file actions
47 lines (43 loc) · 1.49 KB
/
GroupManagePlugin.php
File metadata and controls
47 lines (43 loc) · 1.49 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
<?php
namespace kjBotModule\kj415j45\CoreModule;
use kjBot\Framework\Plugin;
use kjBot\Framework\Event\GroupIncreaseEvent;
use kjBot\Framework\Event\GroupDecreaseEvent;
use kjBot\Framework\DataStorage;
class GroupManagePlugin extends Plugin{
public $handleDepth = 2;
public function notice_group_increase(GroupIncreaseEvent $event){
$gm = GroupManage::Load($event->groupId);
if($gm->_enableWelcomeMsg){
switch($event->subType){
case 'approve':
case 'invite':
if(\Config('self_id') == $event->getId()){
$msg = DataStorage::GetData('GroupManagerIntroduce.txt');
}else{
$msg = $gm->getWelcomeMsg($event);
}
break;
default:
p('未知的入群事件:'.export($event));
}
}
return $event->sendBack($msg);
}
public function notice_group_decrease(GroupDecreaseEvent $event){
$gm = GroupManage::Load($event->groupId);
if($gm->_enableLeaveMsg){
switch($event->subType){
case 'leave':
case 'kick':
$msg = $gm->getLeaveMsg($event);
break;
case 'kick_me':
return;
default:
p('未知的退群事件:'.export($event));
}
}
return $event->sendBack($msg);
}
}