forked from Hanson/vbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.php
94 lines (92 loc) · 2.61 KB
/
config.php
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
$path = __DIR__.'/./../tmp/';
return [
'path' => $path,
/*
* swoole 配置项(执行主动发消息命令必须要开启)
*/
'swoole' => [
'status' => false,
'ip' => '127.0.0.1',
'port' => '8866',
],
/*
* 下载配置项
*/
'download' => [
'image' => false,
'voice' => false,
'video' => false,
'emoticon' => true,
'file' => false,
'emoticon_path' => $path.'emoticons',
],
/*
* 输出配置项
*/
'console' => [
'output' => true, // 是否输出
'message' => true, // 是否输出接收消息 (若上面为 false 此处无效)
],
/*
* 日志配置项
*/
'log' => [
'level' => 'debug',
'permission' => 0777,
'system' => $path.'log',
'message' => $path.'log',
],
/*
* 缓存配置项
*/
'cache' => [
'default' => 'redis',
'stores' => [
'file' => [
'driver' => 'file',
'path' => $path.'cache',
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
],
],
'database' => [
'redis' => [
'client' => 'predis',
'default' => [
'host' => '127.0.0.1',
'password' => null,
'port' => 6379,
'database' => 13,
],
],
],
/*
* 拓展配置
* ==============================
* 如果加载拓展则必须加载此配置项
*/
'extension' => [
// 管理员配置(必选),优先加载 remark_name
'admin' => [
'remark' => '',
'nickname' => 'HanSon',
],
'blacklist' => [
'type' => [
'text', 'emoticon'
],
'warn' => function ($message) {
$nickname = $message['fromType'] == 'Group' ? $message['sender']['NickName'] : $message['from']['NickName'];
\Hanson\Vbot\Message\Text::send($message['from']['UserName'], "@{$nickname} 警告!你的消息频率略高!");
},
'block' => function ($message) {
$nickname = $message['fromType'] == 'Group' ? $message['sender']['NickName'] : $message['from']['NickName'];
\Hanson\Vbot\Message\Text::send($message['from']['UserName'], "@{$nickname} 你已被永久拉黑!");
},
]
],
];