Giter Club home page Giter Club logo

ts3-music-bot's Introduction

TeamSpeak 3 Music Bot

TeamSpeak 3 Music Bot in Node.js with some cool features

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

Installation

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) and desktop environment (to launch the TS3 Client).

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

Step 1

  • Clone this repo to your local machine:
git clone https://github.com/xDroni/TS3-Music-Bot.git

Step 2

  • Install packages:
npm install

The main dependency (ytdl-core) is frequently updated. In case of any problems, try npm update ytdl-core first.

Step 3

  • (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).

Step 4

  • Launch your TeamSpeak 3 Client and connect to the server.

Step 5

  • 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"

(optional) Auto-restart bash script (on error)

#!/bin/bash
while true
do
    npm start host="server_address" login="query_login" password="query_password" botname="MusicBotName" clientname="ClientName"
    sleep 1
done

If you run the bot with this script, it will automatically restart in case of an unexpected error.

TeamSpeak 3 client capture settings

TS3 Capture Settings

TS3 Capture Settings

(optional part)

My sound settings using PulseEffects with equalizer

ALSA plug-in [node] will appear when you add the song to the queue

Sound settings

Sound settings

Sound settings

Sound settings

Usage

Once you have everything set up, you can start using commands.

Music

Add song to the queue

!play <title or link to the song>

alias: !s and !sr

Add playlist

!playlist <link to the playlist>

alias: !p

Note that the regular queue has priority over the playlist.

Add a playlist and shuffle it

!p m/mix/shuffle <link to the playlist>

You can also shuffle the playlist later using

!m, !mix or !shuffle

List the next 5 songs in the queue / playlist

!list

alias: !l

Get the title of the current song

!current

alias !c

Skip the current song

!skip

Remove the last added song from the queue

!skiplast

alias !sl

Remove all songs from the queue

!skipall

alias !sa

Get the queue length

!size

alias !length

Play the previously played song

!previous

alias: !last

Other

Exit the music bot

!exit

If you run the bot using the auto-restart script, the !exit command will also work as an on-demand restart.

ts3-music-bot's People

Contributors

aktyn avatar dependabot[bot] avatar xdroni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ts3-music-bot's Issues

Error

<10:32:37> "TS3AudioBot": Error: You cannot execute 'server tree'. You are missing the 'cmd.server.tree' right!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.