node-ts3-bot
A simple bot framework for TeamSpeak3
Install
npm install cmr1-ts3-bot --save
Usage
// Require cmr1-ts3-botconst Bot = ; // Create a new bot with desired configuration (these are the default values)const 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; // Listen for the bot's "ready" event (emitted after succesfull "init")bot; // Listen for the bot's "join" event (the bot will automatically join the channel specified)bot; // Register a command for this bot that can be invoked in the channel chatbot;
Configuration
The bot can be configured when created (as shown above) or using environment variables:
# Bot Settings BOT_VERBOSE=0BOT_NAME=Woodhouse # TS3 Settings TS3_SID=1TS3_USER=serveradminTS3_PASS=passwordTS3_CHANNEL=Default ChannelTS3_HOST=127.0.0.1TS3_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