karin-plugin-teamspeak 1.3.4 → 1.4.1

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.
@@ -8,13 +8,12 @@ import teamspeak3 from "./ts3.js";
8
8
  export const image = karin.command(/^#?人数$/, async (e) => {
9
9
  try {
10
10
  //默认尝试使用渲染器,调用失败则表示未连接将使用文字形式发送服务器人数
11
- let usePuppeteer = true;
12
- try {
13
- render.App();
14
- }
15
- catch (error) {
16
- usePuppeteer = false;
17
- }
11
+ let usePuppeteer = false;
12
+ // try {
13
+ // render.App()
14
+ // } catch (error) {
15
+ // usePuppeteer = false
16
+ // }
18
17
  if (usePuppeteer) {
19
18
  const filePath = common.absPath(dirPath + "/resources");
20
19
  const bg = filePath + "/image/bg.png";
package/lib/apps/ts3.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { QueryProtocol, TeamSpeak } from "ts3-nodejs-library";
2
2
  import { config } from "../utils/index.js";
3
- import karin, { logger, render, segment } from "node-karin";
3
+ import karin, { logger, segment } from "node-karin";
4
4
  import moment from "node-karin/moment";
5
5
  logger.info("初始化ts3插件");
6
6
  let disNotifyNameList = [];
@@ -88,17 +88,16 @@ class ts3 {
88
88
  return;
89
89
  }
90
90
  //默认尝试使用渲染器,调用失败则表示未连接渲染器
91
- let usePuppeteer = true;
92
- try {
93
- render.App();
94
- }
95
- catch (error) {
96
- usePuppeteer = false;
97
- }
91
+ let usePuppeteer = false;
92
+ // try {
93
+ // render.App()
94
+ // } catch (error) {
95
+ // usePuppeteer = false
96
+ // }
98
97
  const renderList = [];
99
98
  renderList.push(usePuppeteer
100
- ? `<h1>${config().SERVER_NAME || "TeamSpeak服务器"}</h1>`
101
- : `====${config().SERVER_NAME || "TeamSpeak服务器"}====`);
99
+ ? `<h1>${config().SERVER_NAME || config().HOST}</h1>`
100
+ : `====${config().SERVER_NAME || config().HOST}====`);
102
101
  renderList.push(usePuppeteer
103
102
  ? `<div class="tips">仅展示有人的频道</div>`
104
103
  : `仅展示有人的频道 `);
@@ -152,5 +151,8 @@ class ts3 {
152
151
  };
153
152
  }
154
153
  const teamspeak3 = new ts3();
155
- teamspeak3.init();
154
+ setTimeout(() => {
155
+ //确保配置文件生成且正确保存
156
+ teamspeak3.init();
157
+ }, 1000);
156
158
  export default teamspeak3;
package/lib/web.config.js CHANGED
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "karin-plugin-teamspeak",
3
- "version": "1.3.4",
3
+ "version": "1.4.1",
4
4
  "description": "karin 的 teamspeak 插件",
5
5
  "homepage": "https://github.com/jacksixth/karin-plugin-teamspeak3",
6
6
  "bugs": {
@@ -27,7 +27,7 @@
27
27
  h1 {
28
28
  text-align: center;
29
29
  color: #673AB7;
30
- margin-bottom: 12px;
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
  }