Teamspeak is a VoIP software for voice chatting with friends, but you can also listen to and play music directly on its channels. This tutorial will explain how to create a music bot with Sinusbot. Sinusbot is a music bot for TS3 with a web interface. You can configure it and play and upload songs through your web browser.
Debian 8 VPS with 64-bit (amd64) architecture.
Open port 8087.
5-10 minutes.
The bot uses about 30 MB of RAM and 10 MB of HDD. The remainder of the space can be used for songs.
If you meet the requirements, you can follow these steps to download and install the Sinusbot program.
apt-get update
apt-get install x11vnc xinit xvfb libxcursor1 ca-certificates bzip2 curl libglib2.0-0 nano sudo screenSince it is dangerous to run the program as root, create a user exclusively for Sinusbot and give it a password:
adduser --disabled-login ts3bot
passwd ts3botMake a directory for the program. I recommend /opt/ts3soundboard. Give ownership to the ts3bot user:
mkdir -p /opt/ts3soundboard
chown ts3bot:ts3bot /opt/ts3soundboardGoing forward, we will be working with the ts3bot user. Let’s give permissions to run some required commands as root:
visudoYou will see a file similar to the following appear in a text editor:
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:$
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specificationAt the end of the file, add the following line:
ts3bot ALL=(ALL:ALL) ALLNow, save your changes with Ctrl+O and Enter, then Ctrl+X and Enter. Then, log in as ts3bot with the following command:
su ts3bot
cd /opt/ts3soundboardWe are now in the directory where we will install Sinusbot and Teamspeak, so let’s start with Sinusbot:
curl -O https://frie.se/ts3bot/sinusbot-0.9.8.tar.bz2
tar -xjf sinusbot-0.9.8.tar.bz2
cp config.ini.dist config.iniDone. Continue to the next section for Teamspeak.
As we are setting up a music bot for Teamspeak 3, we also need the Teamspeak 3 application youtube-dl to play the music on the server. Download both and permit them to run the setup:
wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
wget http://dl.4players.de/ts/releases/3.0.18.2/TeamSpeak3-Client-linux_amd64-3.0.18.2.run
sudo chmod 755 TeamSpeak3-Client-linux_amd64-3.0.18.2.run
sudo chmod a+rx /usr/local/bin/youtube-dlRun the TS installer:
./TeamSpeak3-Client-linux_amd64-3.0.18.2.runNow that we have all we need to run the bot, let’s configure it to run properly:
nano config.iniUpdate the config.ini file to include the directories of Teamspeak3 and youtube-dl:
TS3Path = "/opt/ts3soundboard/TeamSpeak3-Client-linux_amd64/ts3client_linux_amd64"
YoutubeDLPath = "/usr/local/bin/youtube-dl"Save the file and exit nano. Move a music-playing plugin to the Teamspeak directory:
cp plugin/libsoundbot_plugin.so /opt/ts3soundboard/TeamSpeak3-Client-linux_amd64/pluginsEdit permissions for the Sinusbot program and check for updates:
sudo chmod 755 ts3bot
./ts3bot -updateYou can start the program and play music now, but it will close after closing your SSH client. You may run it in a screen session to prevent it from closing when you quit your SSH session.
su root
screen
su ts3botRun the following command to start Sinusbot:
xinit /opt/ts3soundboard/ts3bot -- /usr/bin/Xvfb :1 -screen 0 800x600x16 -acYou will see the program output some start-up information. At this point, it’s running. You can now access the web interface with your browser, where you can upload and play songs. Navigate to:
http://your-server-ip:8087/The default login for the web interface is admin the username and foobar the password. Newer versions of Sinusbot do not use the Foobar password; instead, they print a random password to the console on the first startup. Remember to change the password immediately.
Enjoy your music bot!