Skip to content

GAMEBOOK/TS3AudioBot

 
 

Repository files navigation

TS3AudioBot

master develop
Build Status Build Status

About

This is our open-source TeamSpeak 3 audiobot project since we haven't found any other open-source one so far.
The bot has come a long way is pretty stable by now, though somtimes he hangs up or needs some other maintenance.
For now I'd only recomment this bot on small servers since it doesn't cover any more complex right systems and relies on discipline.

How our Bot works

The TS3AudioBot connects with at least 1 TeamSpeak3 Client instance wich allows you to:

  • issue commands to that instance.
  • play music for your channel.
  • tell him to stream to different Channels and/or Users simultaneously with TeamSpeak's whisper feature.

We use a self written TeamSpeak3 Client which gives us very low memory and cpu usage.
About 65MB Ram with 1700+ songs in history indexed
And 4-6% CPU usage on a single shared vCore from a Intel Xeon E5-1650 v2 @ 3.50GHz

Features & Plannings

Done:

  • Extract Youtube and Soundcloud songs as well as stream Twitch
  • Extensive history manager, including features like:
    • getting the last x played songs
    • get last x songs played by a certain user
    • start any once played song again via id
    • search in title from played songs
    • (planned) combined search expressions
  • (un)subscribe to the Bob to hear music in any channel
  • (un)subscribe the Bob to certain channels
  • Playlist management for all users
  • broken | Basic plugin support

In progress:

  • Web API

In planning:

  • Create multiple client instances automatically for diffrent channels
  • (Improved) Rights system
  • Own web-interface

Bot Commands

All in all, the bot is fully operable only via chat (and actually only via chat).
Commands are invoked with !command.
Some commands have restrictions, like they can only be used in a private chat, only in public chat, or need admin rights.

For the full command list and tutorials see here in the wiki

If the bot can't play some youtube videos it might be due to some embedding restrictions, which are blocking this.
You can add a youtube-dl binary or source folder and specify the path in the config to try to bypass this.

How to set up the bot

Dependencies

  • Any C# Compiler (Visual Studio or mono 5.0.0+ and msbuild)
  • (Linux only) A C Compiler for Opus

Compilation

Before we start: If you know what you are doing you can alternatively compile each depenency referenced here from source/git by yourself, but I won't add a tutorial for that.

Download the git repository with git clone https://github.com/Splamy/TS3AudioBot.git.

Linux

  1. See if you have NuGet by just executing nuget. If not, get NuGet.exe with wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
  2. Go into the directory of the repository with cd TS3AudioBot
  3. Execute nuget restore or mono ../Nuget.exe restore to download all dependencies
  4. Execute msbuild /p:Configuration=Release /p:Platform=x86 TS3AudioBot.sln to build the C# AudioBot
  5. Make the Opus script runnable with chmod u+x InstallOpus.sh and run it with ./InstallOpus.sh
  6. Get the ffmpeg 32bit or 64bit binary.
  7. Extract the ffmpeg archive with tar -vxf ffmpeg-git-XXbit-static.tar.xz
  8. Get the ffmpeg binary from ffmpeg-git-*DATE*-64bit-static\ffmpeg and copy it to TS3AudioBot/bin/Release/

Windows

  1. Build the C# AudioBot with Visual Studio.
  2. Download the latest libopus file from here
  3. Open the archive and copy the file from opusfile-0.7-win32\libopus-0.dll, move and rename it to TS3AudioBot\bin\Release\libopus.dll
  4. Get the ffmpeg 32bit or 64bit binary.
  5. Open the archive and copy the ffmpeg binary from ffmpeg-latest-winXX-static\bin\ffmpeg.exe to TS3AudioBot\bin\Release\

Installation

  1. Create a group for the AudioBotAdmin with no requirements (just ensure a high enough i_group_needed_member_add_power).
  2. Create a privilige key for the ServerAdmin group (or a group which has equivalent rights).
  3. The first time you'll need to run mono TS3Audiobot.exe without parameter and it will ask you a few questions. (You can get ServerGroupIds in the rights window.)
  4. Send the bot in a private message !bot setup <key> where <key> is the privilege key from a previous step.
  5. Now you can move the process to the backgroud or close the bot with !quit in teamspeak and run it in the background.
    The recommended start from now on is mono TS3AudioBot.exe -q to disable writing to stdout since the bot logs everything to a log file anyway.
  6. Congratz, you're done! Enjoy listening to your favourite music, experimenting with the crazy command system or do whatever you whish to do ;).
    For further reading check out the CommandSystem

Testing and Fuzzying

  1. Run the TS3ABotUnitTests project in Visual Studio or Monodevelop.

About

Advanced Musicbot for Teamspeak 3

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 97.8%
  • Other 2.2%