This commit is contained in:
2021-04-22 00:00:13 +02:00
parent a652d42472
commit 7a668cbd80
7 changed files with 63 additions and 14 deletions

View File

@@ -8,12 +8,18 @@ const nodeInit: NodeInitializer = (RED): void => {
config: Ts3GetConfig
): void {
RED.nodes.createNode(this, config);
this.warn(config.configid)
this.ts3Config = RED.nodes.getNode(config.configid) as Ts3ConfigNode
this.on("input", (msg) => {
msg.payload = this.ts3Config.credentials.username
this.send(msg)
const ts3Config = RED.nodes.getNode(config.configid) as Ts3ConfigNode
this.on("input", async (msg,send,done) => {
const client = await ts3Config.getConnection()
let clients = await client.clientList({ clientType: 0 })
msg.payload = clients
send(msg)
done()
})
}