karin-plugin-teamspeak 1.5.9 → 1.6.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/config/config/config.d.ts +1 -0
- package/config/config/config.json +2 -1
- package/lib/apps/ts3.js +11 -0
- package/lib/web.config.d.ts +1 -1
- package/lib/web.config.js +21 -0
- package/package.json +1 -1
package/lib/apps/ts3.js
CHANGED
|
@@ -62,6 +62,17 @@ class ts3 {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
|
+
// 监听用户移动频道事件
|
|
66
|
+
_teamspeak.on("clientmoved", (e) => {
|
|
67
|
+
if (TS.ENABLE_CHANNEL_MOVE_NOTIFY === "true" && e.client && !disNotifyNameList.includes(e.client.nickname)) {
|
|
68
|
+
logger.info(loggerPluginName + e.client.nickname + "移动到频道: " + e.channel.name);
|
|
69
|
+
const msg = segment.text(e.client.nickname + "移动到频道: " + e.channel.name);
|
|
70
|
+
TS.NOTICE_GROUP_NO.forEach((groupNo) => {
|
|
71
|
+
const contact = karin.contact("group", groupNo + "");
|
|
72
|
+
karin.sendMsg(karin.getBotAll()[1].account.selfId, contact, msg);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
});
|
|
65
76
|
};
|
|
66
77
|
//获取ts3服务器的所有对应频道的人 -- 并组装成文字可直接发
|
|
67
78
|
getAllChannelList = async () => {
|
package/lib/web.config.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Config } from "config/config/config";
|
|
|
2
2
|
declare const _default: {
|
|
3
3
|
info: {};
|
|
4
4
|
/** 动态渲染的组件 */
|
|
5
|
-
components: () => (import("node-karin").InputProps | import("node-karin").
|
|
5
|
+
components: () => (import("node-karin").InputProps | import("node-karin").RadioGroupProps | import("node-karin").InputGroupProps)[];
|
|
6
6
|
/** 前端点击保存之后调用的方法 */
|
|
7
7
|
save: (config: Config) => {
|
|
8
8
|
success: boolean;
|
package/lib/web.config.js
CHANGED
|
@@ -108,6 +108,27 @@ export default {
|
|
|
108
108
|
},
|
|
109
109
|
data: [...config().DIS_NOTIFY_NAME_LIST],
|
|
110
110
|
}),
|
|
111
|
+
components.radio.group("ENABLE_CHANNEL_MOVE_NOTIFY", {
|
|
112
|
+
defaultValue: config().ENABLE_CHANNEL_MOVE_NOTIFY ? "true" : "false",
|
|
113
|
+
label: "移动频道播报功能",
|
|
114
|
+
description: "当用户在Teamspeak中移动频道时自动播报",
|
|
115
|
+
size: "sm",
|
|
116
|
+
orientation: "horizontal",
|
|
117
|
+
radio: [
|
|
118
|
+
{
|
|
119
|
+
componentType: "radio",
|
|
120
|
+
key: "ENABLE_CHANNEL_MOVE_NOTIFY_TRUE",
|
|
121
|
+
value: "true",
|
|
122
|
+
label: "开启",
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
componentType: "radio",
|
|
126
|
+
key: "ENABLE_CHANNEL_MOVE_NOTIFY_FALSE",
|
|
127
|
+
value: "false",
|
|
128
|
+
label: "关闭",
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
}),
|
|
111
132
|
],
|
|
112
133
|
/** 前端点击保存之后调用的方法 */
|
|
113
134
|
save: (config) => {
|