Closed XeroxDev closed 6 years ago
I've never tried to use my package with promise, i'll made some tests and come back later with required enhancements and examples ;)
Wow, nice!
And thanks for this fast answer! :)
And a list with all on("cliententerview") events would be nice.
Edit: Nevermind, found a small list :D
I don't understand your last message, all events are available into the PDF provided with the server. I can add a list to the README but the client don't use a stored list, if the TeamSpeak devs add a new notice it will be supported without any client update.
I'm currently testing the promise implementation, it should be released this week.
I don't understand your last message, all events are available into the PDF provided with the server. I can add a list to the README but the client don't use a stored list, if the TeamSpeak devs add a new notice it will be supported without any client update.
I already found a list. But thanks :D
I'm currently testing the promise implementation, it should be released this week.
Ok, nice. I'm happy about this.
I finally had some time to develop the client, and it become fairly stable.
As soon as I still have a little time I write unit tests and publish it ;)
Here is a small example:
import QueryClient, {iError, iHost} from "@ts3/query-client";
let host: string = '127.0.0.1';
let port: number = 10011;
let user: string = "serveradmin";
let pass: string = "fernand";
let shutdown = (i: number = 1) => {
console.log(`Process exit ${i}`);
process.exit(i);
};
let TS3Client = new QueryClient;
TS3Client.on("connect", (host, port) => {
console.log(`connected to ${host}:${port}!`)
});
TS3Client.on("error", (error) => {
console.log(error);
});
(async () => {
await TS3Client.connect(host, port).catch((e: iError) => {
console.log(e.id, e.msg);
shutdown();
});
let logged = await TS3Client.send(`login ${user} ${pass}`);
if(!logged) return shutdown();
console.log('Logged in!');
})();
Wow, very pretty nice! ❤
I've released a first version without units tests for testing purpose, take a look at v3 branch, this is clearly a pre-release ;)
You can install it with npm install antoine-pous/node-teamspeak3-client#v3
, feel free to open tickets if you found any issue ;)
Hey!
Is there a way to use await for the query's, because I think it's better then 1000 callbacks stacked into another. And can you maybe add more informations like: isConnected?
Exampel:
and it is better for multiple event handlings.
Or can you give me more examples, how I can do better Event-Handling without these 1000 callbacks?
Kind regards XeroxDev