node-karin 0.7.2 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,3 +35,8 @@ GroupConfig:
35
35
 
36
36
  # 黑名单插件、功能,黑名单中的插件、功能不会响应
37
37
  disable: false
38
+
39
+ # 私聊
40
+ PrivateConfig:
41
+ # 是否开启私聊
42
+ enable: false
@@ -17,6 +17,13 @@ multi_progress: false
17
17
  # 控制台触发插件日志颜色 十六进制 默认#FFFF00 不支持热更新
18
18
  log_color: "#E1D919"
19
19
 
20
+ # 私聊设置
21
+ private:
22
+ # 关闭私聊后回复的提示词 为空则不回复
23
+ tips: ""
24
+ # 关闭私聊后的用户白名单
25
+ white_list: []
26
+
20
27
  # input适配器配置 以下所有配置均不支持热更新
21
28
  AdapterInput:
22
29
  # 是否启用
@@ -1,74 +1,67 @@
1
1
  name: 应用配置
2
2
  view:
3
- -
4
- key: 黑名单
3
+ - key: 黑名单
5
4
  comment: 黑名单相关
6
- path: 'BlackList'
7
- type: 'group'
5
+ path: "BlackList"
6
+ type: "group"
8
7
  part:
9
- -
10
- key: 黑名单用户
11
- path: 'BlackList.users'
12
- type: 'boolean'
13
- -
14
- key: 黑名单群聊
15
- path: 'BlackList.groups'
16
- type: 'boolean'
17
- -
18
- key: 消息日志黑名单群聊
19
- comment: 设置后不会打印该群的消息日志
20
- path: 'BlackList.GroupMsgLog'
21
- type: 'boolean'
22
- -
23
- key: 白名单
8
+ - key: 黑名单用户
9
+ path: "BlackList.users"
10
+ type: "boolean"
11
+ - key: 黑名单群聊
12
+ path: "BlackList.groups"
13
+ type: "boolean"
14
+ - key: 消息日志黑名单群聊
15
+ comment: 设置后不会打印该群的消息日志
16
+ path: "BlackList.GroupMsgLog"
17
+ type: "boolean"
18
+ - key: 白名单
24
19
  comment: 白名单相关
25
- path: 'WhiteList'
26
- type: 'group'
20
+ path: "WhiteList"
21
+ type: "group"
27
22
  part:
28
- -
29
- key: 白名单用户
30
- path: 'WhiteList.users'
31
- type: 'boolean'
32
- -
33
- key: 白名单群聊
34
- path: 'WhiteList.groups'
35
- type: 'boolean'
36
- -
37
- key: 消息日志白名单群聊
38
- comment: 消息日志白名单群聊 设置后只会打印该群的消息日志
39
- path: 'WhiteList.GroupMsgLog'
40
- type: 'boolean'
41
- -
42
- key: 群聊
43
- path: 'GroupConfig'
44
- type: 'group'
23
+ - key: 白名单用户
24
+ path: "WhiteList.users"
25
+ type: "boolean"
26
+ - key: 白名单群聊
27
+ path: "WhiteList.groups"
28
+ type: "boolean"
29
+ - key: 消息日志白名单群聊
30
+ comment: 消息日志白名单群聊 设置后只会打印该群的消息日志
31
+ path: "WhiteList.GroupMsgLog"
32
+ type: "boolean"
33
+ - key: 群聊
34
+ path: "GroupConfig"
35
+ type: "group"
45
36
  part:
46
- -
47
- key: 消息冷却时间
48
- comment: 群聊中所有消息冷却时间
49
- path: 'GroupConfig.GroupCD'
50
- type: 'boolean'
51
- -
52
- key: 个人消息冷却时间
53
- comment: 群聊中 每个人的消息冷却时间
54
- path: 'GroupConfig.GroupUserCD'
55
- type: 'boolean'
56
- -
57
- key: 机器人响应模式
58
- path: 'GroupConfig.mode'
59
- type: 'boolean'
60
- -
61
- key: 机器人前缀
62
- comment: 机器人前缀 设置后前缀+指令触发机器人
63
- path: 'GroupConfig.alias'
64
- type: 'boolean'
65
- -
66
- key: 白名单插件、功能
67
- comment: 白名单插件、功能,只有在白名单中的插件、功能才会响应
68
- path: 'GroupConfig.enable'
69
- type: 'boolean'
70
- -
71
- key: 黑名单插件、功能
72
- comment: 黑名单插件、功能,黑名单中的插件、功能不会响应
73
- path: 'GroupConfig.disable'
74
- type: 'boolean'
37
+ - key: 消息冷却时间
38
+ comment: 群聊中所有消息冷却时间
39
+ path: "GroupConfig.GroupCD"
40
+ type: "boolean"
41
+ - key: 个人消息冷却时间
42
+ comment: 群聊中 每个人的消息冷却时间
43
+ path: "GroupConfig.GroupUserCD"
44
+ type: "boolean"
45
+ - key: 机器人响应模式
46
+ path: "GroupConfig.mode"
47
+ type: "boolean"
48
+ - key: 机器人前缀
49
+ comment: 机器人前缀 设置后前缀+指令触发机器人
50
+ path: "GroupConfig.alias"
51
+ type: "boolean"
52
+ - key: 白名单插件、功能
53
+ comment: 白名单插件、功能,只有在白名单中的插件、功能才会响应
54
+ path: "GroupConfig.enable"
55
+ type: "boolean"
56
+ - key: 黑名单插件、功能
57
+ comment: 黑名单插件、功能,黑名单中的插件、功能不会响应
58
+ path: "GroupConfig.disable"
59
+ type: "boolean"
60
+ - key: 私聊
61
+ path: "PrivateConfig"
62
+ type: "group"
63
+ part:
64
+ - key: 是否开启私聊
65
+ comment: 是否开启私聊
66
+ path: "PrivateConfig.enable"
67
+ type: "boolean"
@@ -1,102 +1,170 @@
1
1
  name: 通用配置
2
2
  view:
3
- - key: 日志等级
4
- comment: 日志等级:trace,debug,info,warn,fatal,mark,error,off
5
- path: "log_level"
6
- type: "select"
7
- multiple: false
8
- item:
9
- - name: Trace
10
- value: trace
11
- - name: Debug
12
- value: ebug
13
- - name: Info
14
- value: info
15
- - name: Warn
16
- value: warn
17
- - name: Fatal
18
- value: fatal
19
- - name: Mark
20
- value: mark
21
- - name: Error
22
- value: error
23
- - name: Off
24
- value: off
25
- - key: 日志保留天数
26
- path: "log_days_Keep"
27
- type: "number"
3
+ - key: 日志配置
4
+ comment: log4js日志配置
5
+ path: log4jsCfg
6
+ type: group
7
+ part:
8
+ - key: 日志等级
9
+ comment: 日志等级:trace,debug,info,warn,fatal,mark,error,off
10
+ path: log_level
11
+ type: select
12
+ multiple: false
13
+ item:
14
+ - name: Trace
15
+ value: trace
16
+ - name: Debug
17
+ value: ebug
18
+ - name: Info
19
+ value: info
20
+ - name: Warn
21
+ value: warn
22
+ - name: Fatal
23
+ value: fatal
24
+ - name: Mark
25
+ value: mark
26
+ - name: Error
27
+ value: error
28
+ - name: Off
29
+ value: off
30
+ - key: 日志保留天数
31
+ path: log_days_Keep
32
+ type: number
33
+ - key: 整体化
34
+ comment: 将日志输出到一个文件(一天为一个文件) 日志较多的情况下不建议与碎片化同时开启
35
+ path: overall
36
+ type: boolean
37
+ - key: 碎片化
38
+ comment: 将日志分片,达到指定大小后自动切割 日志较多的情况下不建议与整体化同时开启
39
+ path: fragments
40
+ type: boolean
41
+ - key: 日志文件最大大小
42
+ comment: 日志文件最大大小 MB
43
+ path: maxLogSize
44
+ type: number
45
+
46
+ - key: 后台进程
47
+ comment: 关闭后台进程失败后是否继续启动 继续启动会导致多进程
48
+ path: multi_progress
49
+ type: boolean
50
+
51
+ - key: 控制台插件日志颜色
52
+ comment: 控制台触发插件日志颜色 十六进制 默认#FFFF00 不支持热更新
53
+ path: log_color
54
+ type: text
55
+
56
+ - key: 私聊设置
57
+ comment: 私聊设置
58
+ path: private
59
+ type: group
60
+ part:
61
+ - key: 关闭私聊提示词
62
+ comment: 关闭私聊后回复的提示词 为空则不回复
63
+ path: tips
64
+ type: text
65
+ - key: 关闭私聊白名单
66
+ comment: 关闭私聊后的用户白名单
67
+ path: white_list
68
+ type: array
69
+
70
+ - key: input适配器配置
71
+ comment: input适配器配置 以下所有配置均不支持热更新
72
+ path: AdapterInput
73
+ type: group
74
+ part:
75
+ - key: 是否启用
76
+ comment: 是否启动input适配器
77
+ path: enable
78
+ type: boolean
79
+ - key: 是否转为文件
80
+ comment: 是否将语音、图片、视频消息转为文件 转为文件后可通过url访问
81
+ path: msgToFile
82
+ type: boolean
83
+ - key: url访问token
84
+ comment: url访问token 如果为 AdapterInput 每次启动后会重新生成
85
+ path: token
86
+ type: text
87
+ - key: 访问ip
88
+ comment: 访问ip
89
+ path: ip
90
+ type: text
91
+
28
92
  - key: ffmpeg路径
29
93
  comment: ffmpeg配置 用于音视频处理
30
- path: "ffmpeg_path"
31
- type: "text"
94
+ path: ffmpeg_path
95
+ type: text
96
+
32
97
  - key: ffprobe路径
33
98
  comment: ffmpeg配置 用于音视频处理
34
- path: "ffprobe_path"
35
- type: "text"
99
+ path: ffprobe_path
100
+ type: text
101
+
36
102
  - key: 主人列表
37
103
  comment: 主人列表 主权限
38
- path: "master"
39
- type: "array"
40
- arrayType: "number"
104
+ path: master
105
+ type: array
106
+ arrayType: number
107
+
41
108
  - key: 管理员列表
42
109
  comment: 管理员列表 子权限
43
- path: "admin"
44
- type: "array"
45
- arrayType: "number"
110
+ path: admin
111
+ type: array
112
+ arrayType: number
113
+
46
114
  - key: 黑名单
47
115
  comment: 黑名单相关
48
- path: "BlackList"
49
- type: "group"
116
+ path: BlackList
117
+ type: group
50
118
  part:
51
119
  - key: 黑名单用户
52
- path: "BlackList.users"
53
- type: "array"
54
- arrayType: "number"
120
+ path: BlackList.users
121
+ type: array
122
+ arrayType: number
55
123
  associated:
56
124
  - file: App
57
- path: "BlackList.users"
125
+ path: BlackList.users
58
126
  requirement: true
59
127
  - key: 黑名单群聊
60
- path: "BlackList.groups"
61
- type: "array"
62
- arrayType: "number"
128
+ path: BlackList.groups
129
+ type: array
130
+ arrayType: number
63
131
  associated:
64
132
  - file: App
65
- path: "BlackList.groups"
133
+ path: BlackList.groups
66
134
  requirement: true
67
135
  - key: 消息日志黑名单群聊
68
136
  comment: 设置后不会打印该群的消息日志
69
- path: "BlackList.GroupMsgLog"
70
- type: "array"
71
- arrayType: "number"
137
+ path: BlackList.GroupMsgLog
138
+ type: array
139
+ arrayType: number
72
140
  associated:
73
141
  - file: App
74
- path: "BlackList.GroupMsgLog"
142
+ path: BlackList.GroupMsgLog
75
143
  requirement: true
76
144
  - key: 白名单
77
145
  comment: 白名单相关
78
- path: "WhiteList"
79
- type: "group"
146
+ path: WhiteList
147
+ type: group
80
148
  part:
81
149
  - key: 白名单用户
82
- path: "WhiteList.users"
83
- type: "boolean"
150
+ path: WhiteList.users
151
+ type: boolean
84
152
  associated:
85
153
  - file: App
86
- path: "WhiteList.users"
154
+ path: WhiteList.users
87
155
  requirement: true
88
156
  - key: 白名单群聊
89
- path: "WhiteList.groups"
90
- type: "boolean"
157
+ path: WhiteList.groups
158
+ type: boolean
91
159
  associated:
92
160
  - file: App
93
- path: "WhiteList.groups"
161
+ path: WhiteList.groups
94
162
  requirement: true
95
163
  - key: 消息日志白名单群聊
96
164
  comment: 消息日志白名单群聊 设置后只会打印该群的消息日志
97
- path: "WhiteList.GroupMsgLog"
98
- type: "boolean"
165
+ path: WhiteList.GroupMsgLog
166
+ type: boolean
99
167
  associated:
100
168
  - file: App
101
- path: "WhiteList.GroupMsgLog"
169
+ path: WhiteList.GroupMsgLog
102
170
  requirement: true
@@ -1,25 +1,20 @@
1
1
  name: 数据库配置
2
2
  view:
3
- -
4
- key: redis地址
5
- path: 'host'
6
- type: 'text'
7
- -
8
- key: redis端口
9
- path: 'port'
10
- type: 'number'
11
- -
12
- key: redis用户名
3
+ - key: redis地址
4
+ path: "host"
5
+ type: "text"
6
+ - key: redis端口
7
+ path: "port"
8
+ type: "number"
9
+ - key: redis用户名
13
10
  comment: redis用户名,可以为空
14
- path: 'username'
15
- type: 'text'
16
- -
17
- key: redis密码
11
+ path: "username"
12
+ type: "text"
13
+ - key: redis密码
18
14
  comment: redis密码,没有密码可以为空
19
- path: 'password'
20
- type: 'password'
21
- -
22
- key: 数据库
15
+ path: "password"
16
+ type: "password"
17
+ - key: 数据库
23
18
  comment: 运行中第几个redis数据库
24
- path: 'db'
25
- type: 'number'
19
+ path: "db"
20
+ type: "number"
@@ -1,93 +1,73 @@
1
1
  name: 服务配置
2
2
  view:
3
- -
4
- key: 热更新是否重启服务
3
+ - key: 热更新是否重启服务
5
4
  comment: 当前文件热更新是否重启http、grpc服务
6
- path: 'HotUpdate'
7
- type: 'boolean'
8
- -
9
- key: http 服务器配置
10
- path: 'http'
11
- type: 'group'
5
+ path: "HotUpdate"
6
+ type: "boolean"
7
+ - key: http 服务器配置
8
+ path: "http"
9
+ type: "group"
12
10
  part:
13
- -
14
- key: 监听地址
15
- path: 'http.host'
16
- type: 'text'
17
- -
18
- key: 端口
19
- path: 'http.port'
20
- type: 'number'
21
- -
22
- key: grpc 服务器配置
23
- path: 'grpc'
24
- type: 'group'
11
+ - key: 监听地址
12
+ path: "http.host"
13
+ type: "text"
14
+ - key: 端口
15
+ path: "http.port"
16
+ type: "number"
17
+ - key: grpc 服务器配置
18
+ path: "grpc"
19
+ type: "group"
25
20
  part:
26
- -
27
- key: 监听地址
28
- path: 'grpc.host'
29
- type: 'text'
30
- -
31
- key: Api请求超时时间
32
- path: 'grpc.timeout'
33
- type: 'number'
34
- suffix:
35
- -
36
- key: websocket 服务器配置
37
- path: 'websocket'
38
- type: 'group'
21
+ - key: 监听地址
22
+ path: "grpc.host"
23
+ type: "text"
24
+ - key: Api请求超时时间
25
+ path: "grpc.timeout"
26
+ type: "number"
27
+ suffix:
28
+ - key: websocket 服务器配置
29
+ path: "websocket"
30
+ type: "group"
39
31
  part:
40
- -
41
- key: API请求超时时间
42
- path: 'websocket.timeout'
43
- type: 'number'
44
- suffix:
45
- -
46
- key: websocket 渲染器地址
47
- comment: ws://127.0.0.1:7005/ws/render
48
- path: 'websocket.render'
49
- type: 'array'
50
- arrayType: 'text'
51
- -
52
- key: onebot11 正向WebSocket地址
53
- path: 'websocket.OneBot11Host'
54
- type: 'array'
55
- arrayType: 'text'
56
- -
57
- key: onebot12 正向WebSocket地址
58
- path: 'websocket.OneBot12Host'
59
- type: 'array'
60
- arrayType: 'text'
61
- -
62
- key: HTTP渲染器配置
63
- path: 'HttpRender'
64
- type: 'group'
32
+ - key: API请求超时时间
33
+ path: "websocket.timeout"
34
+ type: "number"
35
+ suffix:
36
+ - key: websocket 渲染器地址
37
+ comment: ws://127.0.0.1:7005/ws/render
38
+ path: "websocket.render"
39
+ type: "array"
40
+ arrayType: "text"
41
+ - key: onebot11 正向WebSocket地址
42
+ path: "websocket.OneBot11Host"
43
+ type: "array"
44
+ arrayType: "text"
45
+ - key: onebot12 正向WebSocket地址
46
+ path: "websocket.OneBot12Host"
47
+ type: "array"
48
+ arrayType: "text"
49
+ - key: HTTP渲染器配置
50
+ path: "HttpRender"
51
+ type: "group"
65
52
  part:
66
- -
67
- key: 是否开启http渲染
68
- path: 'HttpRender.enable'
69
- type: 'boolean'
70
- -
71
- key: karin端Api地址
72
- comment: 公网 > 局域网 > 127
73
- path: 'HttpRender.host'
74
- type: 'url'
75
- -
76
- key: karin-puppeteer渲染器 post请求地址
77
- path: 'HttpRender.post'
78
- type: 'url'
79
- -
80
- key: karin-puppeteer渲染器 post请求token
81
- path: 'HttpRender.token'
82
- type: 'text'
83
- -
84
- key: 请求的非html或非有效路径的返回内容
85
- comment: 可以填http地址 例如:https://ys.mihoyo.com
86
- path: 'HttpRender.not_found'
87
- type: 'text'
88
- -
89
- key: Wormhole代理地址
90
- comment: 无公网IP环境的情况下使用
91
- path: 'HttpRender.WormholeClient'
92
- type: 'text'
93
-
53
+ - key: 是否开启http渲染
54
+ path: "HttpRender.enable"
55
+ type: "boolean"
56
+ - key: karin端Api地址
57
+ comment: 公网 > 局域网 > 127
58
+ path: "HttpRender.host"
59
+ type: "url"
60
+ - key: karin-puppeteer渲染器 post请求地址
61
+ path: "HttpRender.post"
62
+ type: "url"
63
+ - key: karin-puppeteer渲染器 post请求token
64
+ path: "HttpRender.token"
65
+ type: "text"
66
+ - key: 请求的非html或非有效路径的返回内容
67
+ comment: 可以填http地址 例如:https://ys.mihoyo.com
68
+ path: "HttpRender.not_found"
69
+ type: "text"
70
+ - key: Wormhole代理地址
71
+ comment: 无公网IP环境的情况下使用
72
+ path: "HttpRender.WormholeClient"
73
+ type: "text"
@@ -14,6 +14,10 @@ export default class EventHandler {
14
14
  * 事件处理
15
15
  */
16
16
  review(): boolean;
17
+ /**
18
+ * 处理私聊功能 功能开启返回true
19
+ */
20
+ private(): boolean;
17
21
  /**
18
22
  * 根据事件类型过滤事件
19
23
  */
@@ -43,6 +43,22 @@ export default class EventHandler {
43
43
  return false
44
44
  }
45
45
 
46
+ /**
47
+ * 处理私聊功能 功能开启返回true
48
+ */
49
+ private () {
50
+ /** 检查私聊是否开启 */
51
+ if (this.e.user_id !== 'input' && this.e.isPrivate && !review.Private()) {
52
+ /** 用户处于白名单 */
53
+ if (config.Config?.private?.white_list?.includes(String(this.e.user_id))) { return true }
54
+ /** 不处于白名单 检查是否存在提示词 */
55
+ if (config.Config?.private?.tips) { this.e.reply(config.Config.private.tips) }
56
+ logger.debug('[消息拦截] 私聊功能未开启')
57
+ return false
58
+ }
59
+ return true
60
+ }
61
+
46
62
  /**
47
63
  * 根据事件类型过滤事件
48
64
  */
@@ -27,6 +27,8 @@ export class MessageHandler extends EventHandler {
27
27
  }
28
28
  /** 处理回复 */
29
29
  this.reply()
30
+ /** 处理私聊 */
31
+ if (!this.private()) { return }
30
32
  /** 处理消息 */
31
33
  this.deal()
32
34
  }
@@ -36,6 +36,7 @@ export default class NoticeHandler extends EventHandler {
36
36
  this.e.isPrivate = true
37
37
  this.e.logText = `[Private:${this.e.sender.nick || ''}(${this.e.user_id})]`
38
38
  logger.bot('info', this.e.self_id, `${logger.green('私聊通知: ')}[${this.e.user_id}(${this.e.sender.nick || ''})] ${this.e.raw_message}`)
39
+ if (!this.private()) { return }
39
40
  } else if (this.e.contact.scene === 'group') {
40
41
  this.e.isGroup = true
41
42
  this.e.logText = `[Group:${this.e.group_id}-${this.e.user_id}(${this.e.sender.nick || ''})]`
@@ -36,6 +36,7 @@ export default class RequestHandler extends EventHandler {
36
36
  this.e.isPrivate = true
37
37
  this.e.logText = `[Private:${this.e.sender.nick || ''}(${this.e.user_id})]`
38
38
  logger.bot('info', this.e.self_id, `${logger.green('私聊请求: ')}[${this.e.user_id}(${this.e.sender.nick || ''})] ${this.e.raw_message}`)
39
+ if (!this.private()) { return }
39
40
  } else if (this.e.contact.scene === 'group') {
40
41
  this.e.isGroup = true
41
42
  this.e.logText = `[Group:${this.e.group_id}-${this.e.user_id}(${this.e.sender.nick || ''})]`
@@ -20,6 +20,7 @@ export declare const review: {
20
20
  UserEnable: (e: KarinEventTypes) => boolean;
21
21
  GroupMsgPrint: (e: KarinEventTypes) => boolean;
22
22
  PluginEnable: (app: PluginApps, config: GroupCfg) => boolean;
23
+ Private: () => boolean;
23
24
  main(): void;
24
25
  /**
25
26
  * 群聊黑白名单 允许哪个群触发事件
@@ -47,4 +48,8 @@ export declare const review: {
47
48
  * 前缀、别名
48
49
  */
49
50
  "__#1@#alias"(): true | undefined;
51
+ /**
52
+ * 私聊功能
53
+ */
54
+ "__#1@#Private"(): true | undefined;
50
55
  };
@@ -16,6 +16,7 @@ export const review = new (class Handler {
16
16
  UserEnable
17
17
  GroupMsgPrint
18
18
  PluginEnable
19
+ Private
19
20
  constructor () {
20
21
  /** 群聊所有消息cd */
21
22
  this.GroupCD = {}
@@ -35,6 +36,8 @@ export const review = new (class Handler {
35
36
  this.GroupMsgPrint = e => true
36
37
  /** 插件黑白名单 哪个插件可以被触发 */
37
38
  this.PluginEnable = (app, config) => true
39
+ /** 私聊功能 */
40
+ this.Private = () => false
38
41
  // 延迟1秒执行
39
42
  setTimeout(() => {
40
43
  this.main()
@@ -51,6 +54,7 @@ export const review = new (class Handler {
51
54
  this.#UserEnable()
52
55
  this.#GroupMsgPrint()
53
56
  this.#PluginEnable()
57
+ this.#Private()
54
58
  }
55
59
 
56
60
  /**
@@ -366,4 +370,17 @@ export const review = new (class Handler {
366
370
  /** 未启用 */
367
371
  this.alias = () => true
368
372
  }
373
+
374
+ /**
375
+ * 私聊功能
376
+ */
377
+ #Private () {
378
+ /** 启用 */
379
+ if (this.App.PrivateConfig?.enable) {
380
+ this.Private = () => true
381
+ return true
382
+ }
383
+ /** 未启用 */
384
+ this.Private = () => false
385
+ }
369
386
  })()
@@ -97,6 +97,13 @@ export interface App {
97
97
  */
98
98
  disable: boolean;
99
99
  };
100
+ /**
101
+ * 私聊
102
+ */
103
+ PrivateConfig: {
104
+ /** 是否开启私聊 */
105
+ enable: boolean;
106
+ };
100
107
  }
101
108
  export interface Config {
102
109
  /**
@@ -210,6 +217,14 @@ export interface Config {
210
217
  */
211
218
  maxLogSize: number;
212
219
  };
220
+ private: {
221
+ /** 是否开启私聊 */
222
+ enable: boolean;
223
+ /** 关闭私聊后回复的提示词 为空则不回复 */
224
+ tips: string;
225
+ /** 关闭私聊后的用户白名单 */
226
+ white_list: string[];
227
+ };
213
228
  }
214
229
  export interface Server {
215
230
  /**
@@ -181,6 +181,10 @@ export const config = new (class Cfg {
181
181
  },
182
182
  master: data.master.map((i) => String(i)),
183
183
  admin: data.admin.map((i) => String(i)),
184
+ private: {
185
+ white_list: data.private.white_list.map((i) => String(i)),
186
+ tips: data.private.tips,
187
+ },
184
188
  }
185
189
  /** 缓存 */
186
190
  this.change.set(key, Config)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-karin",
3
- "version": "0.7.2",
3
+ "version": "0.8.0",
4
4
  "private": false,
5
5
  "description": "基于 Kritor 进行开发的nodejs机器人框架",
6
6
  "homepage": "https://github.com/KarinJS/Karin",