GitXplorerGitXplorer
s

node-ts3sdk-client

public
31 stars
3 forks
6 issues

Commits

List of commits on branch master.
Verified
fea02e389c5a14e3f56beee69ce09a9406804847

Merge pull request #17 from svenpaulsen/dependabot/npm_and_yarn/qs-6.5.3

ssvenpaulsen committed 2 years ago
Verified
d1a3ee570f7071e69425bc19034e08c0fa449638

Bump qs from 6.5.2 to 6.5.3

ddependabot[bot] committed 2 years ago
Verified
9f9ffc9702857c4b4512e8e87615af0d95117a7f

Merge pull request #16 from svenpaulsen/dependabot/npm_and_yarn/json-schema-and-jsprim-0.4.0

ssvenpaulsen committed 2 years ago
Verified
4f5a56d88c511fdabb7d39f5c77e9c9963ae0f10

Bump json-schema and jsprim

ddependabot[bot] committed 2 years ago
Verified
3e2116c225051d52c269d7a4067a7016258a1461

Merge pull request #15 from svenpaulsen/dependabot/npm_and_yarn/tar-6.1.11

ssvenpaulsen committed 3 years ago
Verified
33117cb54c483aaa3a6864d1e64a108d0d086df7

Bump tar from 6.0.2 to 6.1.11

ddependabot[bot] committed 3 years ago

README

The README file for this repository.

TeamSpeak 3 SDK Client Addon for Node.js

Build Status

This native Node.js addon is a wrapper for the TeamSpeak 3 SDK and allows JavaScript implementations of third-party clients using the TeamSpeak 3 ClientLib.

Prerequisites

The following prerequisites are necessary prior to using the addon:

Installing

All dependencies can be installed via npm:

npm install

This will also build build the module for your current platform. If you want to build the addon manually, issue the following commands in the root directory after cloning the repository:

$ node-gyp configure
$ node-gyp build

Testing

Included is a minimal console client to connect to a local TeamSpeak 3 SDK Server.

$ cd node-ts3sdk-client
$ node examples/client_minimal.js

Usage

Please refer to the official TeamSpeak 3 SDK documentation for a list of functions and events available.

Basics

After loading the addon, most TeamSpeak 3 ClientLib features are available in JavaScript. For the sake of convenience the ts3client_ prefix has been removed from function names and some arguments are optional.

const ts3client = require('node-ts3sdk-client');

ts3client.initClientLib(ts3client.LogTypes.CONSOLE, logPath, soundBackendPath);

var schID = ts3client.spawnNewServerConnectionHandler();
var ident = ts3client.createIdentity();

ts3client.startConnection(schID, ident, '127.0.0.1', 9987, 'JohnDoe');

Callbacks

To register a callback to an event triggered by the TeamSpeak 3 ClientLib, use the on method:

ts3client.on('onConnectStatusChangeEvent', function(schID, status, errno)
{
  // your code
});

ts3client.on('onTalkStatusChangeEvent', function(schID, status, isWhisper, clientID)
{
  // your code
});

ts3client.on('onClientMoveEvent', function(schID, clientID, oldChannelID, newChannelID, visibility, moveMessage)
{
  // your code
});

Error Handling

When an error occurs, the addon will throw exceptions:

try
{
  ts3client.openCaptureDevice(schID, undefined, 'some_invalid_capture_device');
}
catch(err)
{
  var errno = ts3client.getLastError();

  console.log('ERROR ' + errno + ': ' + err.message);
}

Known Issues

I am aware that some features of the SDK are not implemented and I am working to update these. Please visit the project on GitHub to view outstanding issues.