Closed jonetiz closed 5 years ago
Hello, this is the code which I am using.
const TeamSpeak3 = require("ts3-nodejs-library"); const ts3 = new TeamSpeak3({ host: "127.0.0.1", queryport: 10011, serverport: 9987, username: "serveradmin", password: "", nickname: "", keepalive: true }) ts3.on("ready", async () => { Promise.all([ ts3.registerEvent("server"), ts3.registerEvent("channel", 0), ts3.registerEvent("textserver"), ts3.registerEvent("textchannel"), ts3.registerEvent("textprivate") ]).then(() => { tpass = Math.random().toString(36).substring(3, 10); ts3.ServerTempPasswordAdd({ duration: 1200, pw: tpass, tcid: 50, tcpw: "onlyplebsinhere" }).then(res => { console.log(`New temporary password generated: ` + tpass); }).catch(e => { console.log(`ERROR GENERATING PASSWORD`); }); }).catch(e => { console.log(`CONNECTION ERROR`); }) })
Yet whenever it is executed, I get an error saying TypeError: TeamSpeak3 is not a constructor
TypeError: TeamSpeak3 is not a constructor
Please check the example on how to create a connection, since version 2.x the TeamSpeak object does not get exported directly anymore
Hello, this is the code which I am using.
Yet whenever it is executed, I get an error saying
TypeError: TeamSpeak3 is not a constructor