karin-plugin-teamspeak 1.3.2 → 1.4.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.
- package/README.md +6 -5
- package/lib/apps/ts3.js +6 -3
- package/lib/web.config.js +5 -6
- package/package.json +8 -2
- package/resources/template/ts3.html +1 -2
package/README.md
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
# karin-plugin-teamspeak3
|
|
2
2
|
|
|
3
|
-
karin 下的 [
|
|
3
|
+
karin 下的 [teamspeak](https://www.teamspeak.com/zh-CN/) 插件,使用ts开发。
|
|
4
4
|
需要搭配 [karin](https://karin.fun/) 使用。
|
|
5
5
|
在用户进入离开ts服务器时在群里发送用户进出提示
|
|
6
6
|
也会响应QQ群或私聊的 `人数` 命令发送当前服务器内有人在的频道的人数和进入时长
|
|
7
7
|
|
|
8
8
|
# 使用方法
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
|
|
10
|
+
1. 安装该插件
|
|
11
|
+
2. 运行一次 `npx karin .`
|
|
12
|
+
3. 在karin web界面的插件页签中配置该插件
|
|
13
|
+
4. 保存后查看命令行是否成功连接服务器
|
package/lib/apps/ts3.js
CHANGED
|
@@ -97,8 +97,8 @@ class ts3 {
|
|
|
97
97
|
}
|
|
98
98
|
const renderList = [];
|
|
99
99
|
renderList.push(usePuppeteer
|
|
100
|
-
? `<h1>${config().SERVER_NAME ||
|
|
101
|
-
: `====${config().SERVER_NAME ||
|
|
100
|
+
? `<h1>${config().SERVER_NAME || config().HOST}</h1>`
|
|
101
|
+
: `====${config().SERVER_NAME || config().HOST}====`);
|
|
102
102
|
renderList.push(usePuppeteer
|
|
103
103
|
? `<div class="tips">仅展示有人的频道</div>`
|
|
104
104
|
: `仅展示有人的频道 `);
|
|
@@ -152,5 +152,8 @@ class ts3 {
|
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
154
|
const teamspeak3 = new ts3();
|
|
155
|
-
|
|
155
|
+
setTimeout(() => {
|
|
156
|
+
//确保配置文件生成且正确保存
|
|
157
|
+
teamspeak3.init();
|
|
158
|
+
}, 1000);
|
|
156
159
|
export default teamspeak3;
|
package/lib/web.config.js
CHANGED
|
@@ -8,14 +8,14 @@ export default {
|
|
|
8
8
|
/** 动态渲染的组件 */
|
|
9
9
|
components: () => [
|
|
10
10
|
components.input.string("HOST", {
|
|
11
|
-
label: "teamspeak
|
|
11
|
+
label: "teamspeak 服务器地址或域名(不带端口)",
|
|
12
12
|
defaultValue: defConfig.HOST,
|
|
13
13
|
variant: "underlined",
|
|
14
|
-
placeholder: "
|
|
14
|
+
placeholder: "请输入服务器地址或域名",
|
|
15
15
|
rules: [
|
|
16
16
|
{
|
|
17
|
-
regex: /^((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$/,
|
|
18
|
-
error: "请输入正确的IP
|
|
17
|
+
regex: /^((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$|^([0-9a-zA-Z-]{1,}\.)+([a-zA-Z]{2,})$/,
|
|
18
|
+
error: "请输入正确的IP地址或域名",
|
|
19
19
|
},
|
|
20
20
|
],
|
|
21
21
|
}),
|
|
@@ -112,9 +112,8 @@ export default {
|
|
|
112
112
|
],
|
|
113
113
|
/** 前端点击保存之后调用的方法 */
|
|
114
114
|
save: (config) => {
|
|
115
|
-
Object.assign(defConfig, config);
|
|
116
|
-
writeJsonSync(`${dirConfig}/config.json`, config);
|
|
117
115
|
logger.info("保存的配置:", config);
|
|
116
|
+
writeJsonSync(`${dirConfig}/config.json`, config);
|
|
118
117
|
// 在这里处理保存逻辑
|
|
119
118
|
return {
|
|
120
119
|
success: true,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "karin-plugin-teamspeak",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "karin 的
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": "karin 的 teamspeak 插件",
|
|
5
5
|
"homepage": "https://github.com/jacksixth/karin-plugin-teamspeak3",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/jacksixth/karin-plugin-teamspeak3/issues"
|
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/jacksixth/karin-plugin-teamspeak3.git"
|
|
12
12
|
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"karin-plugin",
|
|
15
|
+
"teamspeak",
|
|
16
|
+
"karin"
|
|
17
|
+
],
|
|
18
|
+
"license": "GPL-3.0-only",
|
|
13
19
|
"author": "jack",
|
|
14
20
|
"type": "module",
|
|
15
21
|
"main": "lib/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
h1 {
|
|
28
28
|
text-align: center;
|
|
29
29
|
color: #673AB7;
|
|
30
|
-
margin-bottom:
|
|
30
|
+
margin-bottom: 6px;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.tips {
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
|
|
50
50
|
li {
|
|
51
51
|
list-style-type: circle;
|
|
52
|
-
margin-left: 10%;
|
|
53
52
|
color: #3F51B5;
|
|
54
53
|
white-space: nowrap;
|
|
55
54
|
}
|