Socket
Book a DemoInstallSign in
Socket

cmr1-ts3-bot

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cmr1-ts3-bot

TS3 bot

0.1.6
latest
Source
npmnpm
Version published
Weekly downloads
7
-36.36%
Maintainers
1
Weekly downloads
 
Created
Source

npm version build status

node-ts3-bot

A simple bot framework for TeamSpeak3

Install

npm install cmr1-ts3-bot --save

Usage

// Require cmr1-ts3-bot
const Bot = require('cmr1-ts3-bot');

// Create a new bot with desired configuration (these are the default values)
const bot = new Bot({
  sid: 1,
  name: 'Woodhouse',
  user: 'serveradmin',
  pass: 'password',
  host: '127.0.0.1',
  port: 10011,
  channel: 'Default Channel',
  verbose: false
});

// Initialize the bot (callback is optional)
bot.init((err) => {
  if (err) // Something didn't work
  else     // The bot is alive!
});

// Listen for the bot's "ready" event (emitted after succesfull "init")
bot.on('ready', () => {
  // Send a message to the TS3 main server chat
  bot.server.message('Ready for service');
});

// Listen for the bot's "join" event (the bot will automatically join the channel specified)
bot.on('join', channel => {
  // Send a message to the channel that the bot has now joined
  channel.message('I have joined this channel!');
});

// Register a command for this bot that can be invoked in the channel chat
bot.channelCommand('ping', (args, context) => {
  // When someone says "ping" in the bot's channel, reply to that channel with "pong"
  bot.channel.message('pong');
});

Configuration

The bot can be configured when created (as shown above) or using environment variables:

# Bot Settings
BOT_VERBOSE=0
BOT_NAME=Woodhouse

# TS3 Settings
TS3_SID=1
TS3_USER=serveradmin
TS3_PASS=password
TS3_CHANNEL=Default Channel
TS3_HOST=127.0.0.1
TS3_PORT=10011

Methods

  • init
  • disconnect
  • shutdown
  • getServerGroupByName
  • getServer
  • getClientById
  • getClientByName
  • getChannelById
  • getChannelByName
  • globalCommand
  • clientCommand
  • channelCommand
  • serverCommand
  • messageClient
  • messageChannel
  • messageServer

Events

  • ready
  • join
  • action
  • unknowncommand
  • cliententerview
  • clientleftview
  • cliententerchannel
  • clientleftchannel
  • warning
  • failure

Keywords

teamspeak

FAQs

Package last updated on 26 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.