Plugins.php
899 字节
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
<?php
namespace Weasy\Rboot\Plugins\Qywx;
use Weasy\Rboot\Plugins\AbstractPlugin;
use Weasy\Rboot\Rule;
class Plugins extends AbstractPlugin
{
public function name(): string
{
return "qywx";
}
public function scope(): array
{
return ["wxwork"];
}
public function enable()
{
// attach event handlers
$this->bot->on('msg', function (Rule $rule) {
if ($rule->match('/!sync qy (\d+)/')) {
$id = intval($rule->matches[1]);
new Sync($this->bot, $id);
}
});
}
public function description(): string
{
return "企业微信外部联系人Rboot管理插件";
}
public function help(): array
{
return [
"!sync qy `ID`" => "**数据同步**,同步指定`ID`的企业数据,为0则同步全部企业",
];
}
}