Watch the demo: https://streamable.com/crtqz
Features:
-
Music
- adding songs to the queue
- adding playlists (with a shuffle option)
- skipping current song, removing last added song and more
- getting the title of the current song
- listing songs in the queue
- more (see below)
-
Other
- sending a welcome message with some statistics to every user that joins our server
Tested with Node 14+ on Linux, Ubuntu. It may also work on Windows, but has not been tested.
You will need Node.js (at least version 14), ffmpeg,
TeamSpeak3 Client, libasound2-dev
(if on Linux), make
, gcc
, g++
, desktop environment if you don't have one (to launch TS3 Client, I tested gnome
).
Install required dependencies (Ubuntu / Debian):
sudo apt-get install ffmpeg libasound2-dev make gcc g++
Install a desktop environment, if you don't have one:
sudo apt-get install ubuntu-gnome-desktop
or another of your choice.
Bot listens for commands using ServerQuery account, so you need to provide login and password. To reset the password, check: https://support.teamspeak.com/hc/en-us/articles/360002712898
- Clone this repo to your local machine:
git clone https://github.com/xDroni/TS3-Music-Bot.git
- Install packages:
npm install
The main dependency (
@distube/ytdl-core
) is frequently updated. In case of any problems, trynpm update @distube/ytdl-core
first.
- (optional) Copy your YouTube API key into the config.json file, it's located in the src/ directory. This is not necessary, but may speed up the search slightly.
- (optional) If you want to play age-restricted videos, fill in the cookiesArray field in config.json, the cookiesString field will be generated automatically. An easy way to get cookiesArray is to sign in to your verified YouTube account and use a plugin like EditThisCookie (tested on Chrome).
- Launch your TeamSpeak 3 Client and connect to the server.
- On the same machine run the music bot with the following parameters (clientname is the name of the user you set in step 4):
npm start host="server_address" login="query_login" password="query_password" botname="MusicBotName" clientname="ClientName"
It will also try to update the main dependency (
@distube/ytdl-core
)
#!/bin/bash
while true
do
npm start host="server_address" login="query_login" password="query_password" botname="MusicBotName" clientname="ClientName"
npm install @distube/ytdl-core@latest
done
If you run the bot with this script, it will automatically restart in case of an unexpected error.
(optional part)
My sound settings using PulseEffects with equalizer
ALSA plug-in [node] will appear when you add the song to the queue
Once you have everything set up, you can start using commands.
!play <title or link to the song>
alias: !s and !sr
!playlist <link to the playlist>
alias: !p
Note that the regular queue has priority over the playlist.
!p m/mix/shuffle <link to the playlist>
!m
,!mix
or!shuffle
!list
alias: !l
!current
alias !c
!skip
!skiplast
alias !sl
!skipall
alias !sa
!size
alias !length
!previous
alias: !last
!exit
If you run the bot using the auto-restart script, the !exit command will also work as an on-demand restart.