File tree Expand file tree Collapse file tree 1 file changed +61
-1
lines changed Expand file tree Collapse file tree 1 file changed +61
-1
lines changed Original file line number Diff line number Diff line change 1
1
# blacklist
2
- 黑名单
2
+ 黑名单扩展
3
+
4
+ 可检测各种类型消息的发送频率,检测规则:针对消息类型,10秒内发送4次触发警告,7次直接拉黑。
5
+
6
+ ## 要求
7
+
8
+ 安装 redis
9
+
10
+ ## 安装
11
+
12
+ ```
13
+ composer require vbot/blacklist
14
+ ```
15
+
16
+ ## 扩展属性
17
+
18
+ ``` php
19
+ name: blacklist
20
+ zhName: 黑名单
21
+ author: HanSon
22
+ ```
23
+
24
+ ## 触发关键字
25
+
26
+ 无
27
+
28
+ ## 配置项
29
+
30
+ type 为需要检测的消息类型,为一个数组项
31
+
32
+ warn 与 block 都是一个匿名函数
33
+
34
+ ```
35
+ // ...
36
+ 'extension' => [
37
+ // 管理员配置(必选),优先加载 remark_name
38
+ 'admin' => [
39
+ 'remark' => '',
40
+ 'nickname' => 'vbot',
41
+ ],
42
+ 'blacklist' => [
43
+ 'type' => [
44
+ 'text', 'emoticon'
45
+ ],
46
+ 'warn' => function ($message) {
47
+ $nickname = $message['fromType'] == 'Group' ? $message['sender']['NickName'] : $message['from']['NickName'];
48
+ \Hanson\Vbot\Message\Text::send($message['from']['UserName'], "@{$nickname} 警告!你的消息频率略高!");
49
+ },
50
+ 'block' => function ($message) {
51
+ $nickname = $message['fromType'] == 'Group' ? $message['sender']['NickName'] : $message['from']['NickName'];
52
+ \Hanson\Vbot\Message\Text::send($message['from']['UserName'], "@{$nickname} 你已被永久拉黑!");
53
+ },
54
+ ]
55
+ ],
56
+ ```
57
+
58
+ ## 扩展负责人
59
+
60
+ [ HanSon] ( https://github.com/HanSon )
61
+
62
+
You can’t perform that action at this time.
0 commit comments