teamspeak-query
teamspeak-query copied to clipboard
Viewer
Hi, @schroffl. Do you consider an idea to create server viewer (clientlist and channellist), for example in JSON and html format. I found one , but it's seems shitty. For example: query.viewer(format:"json") which returning html or json builded server tree with clients, channels etc
If I understand you correctly you want to be able to get an html-formatted overview that you can e.g. embed in your website?
Yes that is. Building public api for ts users and it will usefull feature
I don't think this is a good addition to this library, because it would clutter the API with functions that probably only very few people use. It would make more sense to create a separate package for this.
@schroffl That should be very cool with using like teamspeak-filesystem package
What exactly do you mean? I don't really get how the HTML-formatted client-/channellist would be useful for the filesystem? Sorry if I misunderstood something ^^
Oh, my english still so bad... Something like that
let teamspeakViewer=require('teamspeak-viewer');
let query=new TeamspeakQuery.Raw(*connection data*);
let viewer=teamspeakViewer(query);
console.log(viewer.json());
console.log(viewer.html());
If you want you can try to build such a package yourself, because I currently don't have the time. And besides, it's a useful learning experience :)
Also: I would just keep it a simple function that takes the client-/channelist output and builds the desired output, e.g. like this:
const viewer = require('teamspeak-viewer');
query.send('clientlist')
.then(viewer.html)
.then(html => { /* Do whatever you want with your html */ });