From efdb8a988ba5402607c5b223da7f1af71ddc6f71 Mon Sep 17 00:00:00 2001 From: Marc Date: Fri, 11 Jan 2019 13:24:11 +0100 Subject: [PATCH] removed viewer.js --- app.js | 32 +++++++++++++++++++++++++++++++- js/viewer.js | 29 ----------------------------- 2 files changed, 31 insertions(+), 30 deletions(-) delete mode 100644 js/viewer.js diff --git a/app.js b/app.js index 5de928b..73b5026 100644 --- a/app.js +++ b/app.js @@ -7,7 +7,37 @@ app.engine('handlebars', exphbs({defaultLayout: 'main'})); app.set('view engine', 'handlebars'); app.get('/', function (req, res) { - res.render('home'); + res.render('home', {foo: 'bar'}); }); app.listen(3000); + +const TeamSpeak3 = require("ts3-nodejs-library") + +var ts3conn = new TeamSpeak3({ + host: "localhost", + queryport: 10011, + serverport: 9987, + username: "serveradmin", + password: "R0cHL6tb", + nickname: "NodeJS Query Framework", +}) + + ts3conn.on("ready", () => { + ts3conn.clientList({client_type:0}).then(clients => { + clients.forEach(client => { + console.log("Online: ", client.getCache().client_nickname) + }) + }).catch(e => console.log("CATCHED", e.message)) + + ts3conn.channelList({}).then(channel => { + channel.forEach(channel => { + console.log("Channel: ", channel.getCache().channel_name) + }) + }).catch(e => console.log("CATCHED", e.message)) + }) + + + + ts3conn.on("error", e => console.log("Error", e.message)) + ts3conn.on("close", e => console.log("Connection has been closed!", e)) diff --git a/js/viewer.js b/js/viewer.js deleted file mode 100644 index a49582a..0000000 --- a/js/viewer.js +++ /dev/null @@ -1,29 +0,0 @@ -const TeamSpeak3 = require("ts3-nodejs-library") - -var ts3conn = new TeamSpeak3({ - host: "localhost", - queryport: 10011, - serverport: 9987, - username: "serveradmin", - password: "R0cHL6tb", - nickname: "NodeJS Query Framework", -}) - - ts3conn.on("ready", () => { - ts3conn.clientList({client_type:0}).then(clients => { - clients.forEach(client => { - console.log("Online: ", client.getCache().client_nickname) - }) - }).catch(e => console.log("CATCHED", e.message)) - - ts3conn.channelList({}).then(channel => { - channel.forEach(channel => { - console.log("Channel: ", channel.getCache().channel_name) - }) - }).catch(e => console.log("CATCHED", e.message)) - }) - - - - ts3conn.on("error", e => console.log("Error", e.message)) - ts3conn.on("close", e => console.log("Connection has been closed!", e))