Review TS3-NodeJS-Library

BIOS

Knowledge Seeker
VIP
Joined
Oct 10, 2015
Messages
372
Points
168
Age
29
Location
Germany
First its not Mine i found this on Github!

TS3-NodeJS-Library
The TS3 NodeJS Library has been strongly influenced by
You do not have permission to view link Log in or register now.


download:
You do not have permission to view link Log in or register now.


Install
npm install ts3-nodejs-library


TODO
  • File upload
  • Channel Browser Access
Documentation
You can find all necessary documentation on the
You do not have permission to view link Log in or register now.
!


Example
Send a message to all non Query Clients connected:
Code:
const TeamSpeak3 = require("ts3-nodejs-library")

//Create a new Connection
var ts3 = new TeamSpeak3({
    host: "localhost",
    queryport: 10011,
    serverport: 9987,
    username: "serveradmin",
    password: "",
    nickname: "NodeJS Query Framework"
})

/*
    Ready gets fired when the Bot has connected to the TeamSpeak Query and
    issued login commands (if username and password has been given)
    selected the appropriate Server (also if given in the config)
    and set the nickname
*/
ts3.on("ready", () => {
    //Retrieves a List of non Query Clients
    ts3.clientList({client_type:0}).then(clients => {
        clients.forEach(client => {
            console.log("Sending Message to", client.getCache().client_nickname)
            //Sends to every Client a "Hello"
            client.message("Hello!")
        })
    }).catch(e => console.log("CATCHED", e.message))
})

ts3.on("error", e => console.log("Error", e.message))
ts3.on("close", e => console.log("Connection has been closed!", e))
 

ewenjo

That norwegian guy
Joined
Dec 14, 2016
Messages
67
Points
57
Location
Norway
Thank you for sharing, currently making a nodejs bot working with TeamSpeak. :)
 

cRaZy92

New Member
Joined
Feb 1, 2019
Messages
4
Points
8
Age
19
Hey,
I was playing little bit with this library and I can't get it to fire textmessage event for some reason, can someone provide example code with more than just ready event?
 

kalle

high minded
Contributor
Joined
Oct 28, 2015
Messages
324
Points
118
Age
23
Location
Bosnia and Herzegovina
Hey,
I was playing little bit with this library and I can't get it to fire textmessage event for some reason, can someone provide example code with more than just ready event?
Posting your code and errors would be nice, maybe we could help.
If you look into this example you will see how it works with subscribe.
 

cRaZy92

New Member
Joined
Feb 1, 2019
Messages
4
Points
8
Age
19
Posting your code and errors would be nice, maybe we could help.
If you look into this example you will see how it works with subscribe.
Ahhhhh... I didn't saw the example folder, thanks. (my stupid mistakes)
 

cRaZy92

New Member
Joined
Feb 1, 2019
Messages
4
Points
8
Age
19
Hello,
I am again here :D I want the bot to be able to respond to text messages in all available channels on a server but not server channel.
I tried provided example from the library but the event fires only when there is new text message in server chat.
Can someone show me some example, please? :/
 

kalle

high minded
Contributor
Joined
Oct 28, 2015
Messages
324
Points
118
Age
23
Location
Bosnia and Herzegovina
Hello,
I am again here :D I want the bot to be able to respond to text messages in all available channels on a server but not server channel.
I tried provided example from the library but the event fires only when there is new text message in server chat.
Can someone show me some example, please? :/
That is not possible in TS. In TS3 you have two possible ways to catch a message. In channel chat or server global chat. To catch message in every channel you have to be in that channel, so that is not possible to do with one query connection.
 

cRaZy92

New Member
Joined
Feb 1, 2019
Messages
4
Points
8
Age
19
That is not possible in TS. In TS3 you have two possible ways to catch a message. In channel chat or server global chat. To catch message in every channel you have to be in that channel, so that is not possible to do with one query connection.
Ohhh, maybe that's reason why no one made something like this... Is there any way to bypass that? Or how to set the channel the bot will listen?

I hope TS5 have api like discord have... :/ it's so easy with discord :(
 

Top