antoine-pous / node-teamspeak3-client

😱 A TeamSpeak3 ServerQuery client with anti-ban feature, prepared statements and a lot of cool stuffs
ISC License
5 stars 0 forks source link

How to use events with node-teamspeak3-client? #2

Closed SomeoneCares11 closed 7 years ago

SomeoneCares11 commented 7 years ago

Hi, i want to send message to member when he joined a channel,

which event do i use, and how to use the events?

thank you

antoine-pous commented 7 years ago

You just have to listen the native event name, i'm sorry i haven't documented it. I'll fix it ASAP ;)

Dramex commented 7 years ago

@antoine-pous Example please

antoine-pous commented 7 years ago

The current behavior, if i'm remember right is register the event

TS3Client.query("servernotifyregister", {event:"server"}, [], function(err, res, raw) {});

and listen the client events

TS3Client.on('notify', function(event, data) {
  // event = notifycliententerview
  // data = the client data
})

But this is not really usefull, i'll change it tonight. The best way is emitting directly cliententerview event, for this example, but it should emit properly any events.

antoine-pous commented 7 years ago

Ok! With this update you can use events, but this is a major release due to imcompatibles changes.

Read carrefully the README, the release notes and the new example ;)

Feel free to open another tickets if you need