Code Monkey home page Code Monkey logo

ts3audiobot's Introduction

TS3AudioBot

This is a open-source TeamSpeak3 bot, playing music and much more.

  • Got questions? Check out our Wiki, FAQ, or ask on our Join Gitter Chat
  • Something's broken or it's complicated? Open an issue
    • Please use and fill out one of the templates we provide unless they are not applicable or you have a good reason not to.
      This helps us getting through the technical stuff faster
    • Please keep issues in english, this makes it easier for everyone to participate and keeps issues relevant to link to.
  • Want to support this Project?
    • You can discuss and suggest features. However the backlog is large and feature requests will probably take time
    • You can contribute code. This is always appreciated, please open an issue or contact a maintainer to discuss before you start.
    • You can support me on Patreon or Paypal

Features

  • Play Youtube and Soundcloud songs as well as stream Twitch (extensible with plugins)
  • Song history
  • Various voice subscription modes; including to clients, channels and whisper groups
  • Playlist management for all users
  • Powerful permission configuration
  • Plugin support
  • Web API
  • Multi-instance
  • Localization
  • Low CPU and memory with our self-written headless ts3 client

To see what's planned and in progress take a look into our Roadmap.

Bot Commands

The bot is fully operable via chat.
To get started write !help to the bot.
For all commands check out our live OpenApiV3 generator.
For an in-depth command tutorial see here in the wiki.

Install

Download

Pick and download the build for your platform and liking:

Stable Experimental
Versions are mostly considered stable but won't get bigger features as fast. Will always have the latest and greatest but might not be fully stable or have broken features.
Windows_x64 Download Download
Linux_x64 Download Download
Docker Docker (NOTE: This build is community-maintained. It comes with all dependencies as well as youtube-dl preconfigured) -

(We have more builds like linux arm/arm64 and .NET framework dependent builds available on our nightly server)

Linux

Install the required dependencies:

  • on Ubuntu/Debian:
    Run sudo apt-get install libopus-dev ffmpeg
  • on Arch Linux:
    Run sudo pacman -S opus ffmpeg
  • on CentOS 7:
    Run
    sudo yum -y install epel-release
    sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
    sudo yum -y install ffmpeg opus-devel
    
  • manually:
    1. Make sure you have a C compiler installed
    2. Make the Opus script runnable with chmod u+x InstallOpus.sh and run it with ./InstallOpus.sh
    3. Get the ffmpeg 32bit or 64bit binary.
    4. Extract the ffmpeg archive with tar -vxf ffmpeg-git-*XXbit*-static.tar.xz
    5. Get the ffmpeg binary from ffmpeg-git-*DATE*-amd64-static/ffmpeg and copy it into your TS3AudioBot folder.

Windows

  1. Get the ffmpeg 32bit or 64bit binary.
  2. Open the archive and copy the ffmpeg binary from ffmpeg-latest-winXX-static/bin/ffmpeg.exe into your TS3AudioBot folder.

Optional Dependencies

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

First time setup

  1. Run the bot with ./TS3AudioBot (Linux) or TS3AudioBot.exe (Windows) and follow the setup instructions.
  2. (Optional) Close the bot and configure your rights.toml to your desires. You can use the template rules as suggested in the automatically generated file, or dive into the rights syntax here. Then start the bot again.
  3. (Optional, but highly recommended for everything to work properly).
    • Create a privilege key for the ServerAdmin group (or a group which has equivalent rights).
    • Send the bot in a private message !bot setup <privilege key>.
  4. 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.

Building manually

master develop
Build status Build status

Download

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

Linux

  1. Get the latest dotnet core 3.1 version by following this tutorial and choose your platform
  2. Go into the directory of the repository with cd TS3AudioBot
  3. Execute dotnet build --framework netcoreapp3.1 --configuration Release TS3AudioBot to build the AudioBot
  4. The binary will be in ./TS3AudioBot/bin/Release/netcoreapp3.1 and can be run with dotnet TS3AudioBot.dll

Windows

  1. Make sure you have Visual Studio with the dotnet core 3.1 development toolchain installed
  2. Build the AudioBot with Visual Studio.

Building the WebInterface

  1. Go with the console of your choice into the ./WebInterface folder
  2. Run npm install to restore or update all dependencies for this project
  3. Run npm run build to build the project.
    The built project will be in ./WebInterface/dist.
    Make sure to the set the webinterface path in the ts3audiobot.toml to this folder.
  4. You can alternatively use npm run start for development.
    This will use the webpack dev server with live reload instead of the ts3ab server.

Community

Localization

๐Ÿ’ฌ Want to help translate or improve translation?
Join us on Transifex to help translate
or in our Gitter to discuss or ask anything!
All help is appreciated โค๏ธ

Translations need to be manually approved and will then be automatically built and deployed to our nightly server here.

License

This project is licensed under OSL-3.0.

Why OSL-3.0:

  • OSL allows you to link to our libraries without needing to disclose your own project, which might be useful if you want to use the TSLib as a library.
  • If you create plugins you do not have to make them public like in GPL. (Although we would be happy if you shared them :)
  • With OSL we want to allow you providing the TS3AB as a service (even commercially). We do not want the software to be sold but the service. We want this software to be free for everyone.
  • TL; DR? https://tldrlegal.com/license/open-software-licence-3.0

forthebadge forthebadge forthebadge forthebadge forthebadge

ts3audiobot's People

Contributors

bluscream avatar cknost avatar everfreefaerie avatar flakebi avatar goemktg avatar hiroko103 avatar kd148 avatar makindotcc avatar senaris avatar splamy avatar wrightblue avatar yakmm 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ts3audiobot's Issues

Build failed (xbuild /p:Configuration=Release TS3AudioBot.sln)

Target ValidateSolutionConfiguration:
                Building solution configuration "Release|x86".
        Target Build:
                Project "/home/hiddenprocess/TS3AudioBot/PluginTests/PluginTests.csproj" (default target(s)):
/home/hiddenprocess/TS3AudioBot/PluginTests/PluginTests.csproj:  warning : Project has unknown ToolsVersion '14.0'. Using the default tools version '4.0' instead.
                        Target PrepareForBuild:
                                Configuration: Release Platform: x86
                        Target GenerateSatelliteAssemblies:
                        No input files were specified for target GenerateSatelliteAssemblies, skipping.
                        Target GenerateTargetFrameworkMonikerAttribute:
                        Skipping target "GenerateTargetFrameworkMonikerAttribute" because its outputs are up-to-date.
                Done building project "/home/hiddenprocess/TS3AudioBot/PluginTests/PluginTests.csproj".-- FAILED
        Task "MSBuild" execution -- FAILED
        Done building target "Build" in project "/home/hiddenprocess/TS3AudioBot/TS3AudioBot.sln".-- FAILED
Done building project "/home/hiddenprocess/TS3AudioBot/TS3AudioBot.sln".-- FAILED

Build FAILED.

Warnings:

/home/hiddenprocess/TS3AudioBot/TS3AudioBot.sln (default targets) ->
(Build target) ->
/home/hiddenprocess/TS3AudioBot/PluginTests/PluginTests.csproj (default targets) ->

        /home/hiddenprocess/TS3AudioBot/PluginTests/PluginTests.csproj:  warning : Project has unknown ToolsVersion '14.0'. Using the default tools version '4.0' instead.

         1 Warning(s)
         0 Error(s)

Add aliases and loops

Command to aliase long command chains
!alias set <"commandchain">
!alias remove ...

Command to run while condition is given
!while

maby for int = i / foreach loops
!for

Commands will need a timeout mechanics !
or execution count limit

Bot crash

I get this error:

[04:21:04]Warning: TH Web error: [403] Forbidden
[04:21:04]  Debug: YT Ruined!
[04:21:07]  Debug: AF stop old
[04:21:07]  Debug: AF ar start: Youtube ID:RZiB5HNPBOs
[04:21:07]  Debug: AF set volume: 5
[04:21:07]  Error: Critical program failure! Logs will follow.
[04:21:07]  Error: MSG: Specified cast is not valid.
TYPE:InvalidCastException
STACK:  at (wrapper castclass) System.Object:__castclass_with_cache (object,intptr,intptr)
  at LiteDB.PageService.GetPage[T] (System.UInt32 pageID) [0x00049] in <443e7085ca5f45b79ebe745a00233d33>:0 
  at LiteDB.IndexService.GetNode (LiteDB.PageAddress address) [0x0000b] in <443e7085ca5f45b79ebe745a00233d33>:0 
  at LiteDB.IndexService.Find (LiteDB.CollectionIndex index, LiteDB.BsonValue value, System.Boolean sibling, System.Int32 order) [0x0002c] in <443e7085ca5f45b79ebe745a00233d33>:0 
  at LiteDB.QueryEquals+<ExecuteIndex>d__2.MoveNext () [0x00022] in <443e7085ca5f45b79ebe745a00233d33>:0 
  at LiteDB.LiteEngine+<Find>d__49.MoveNext () [0x001a5] in <443e7085ca5f45b79ebe745a00233d33>:0 
  at LiteDB.LiteCollection`1+<Find>d__17[T].MoveNext () [0x00070] in <443e7085ca5f45b79ebe745a00233d33>:0 
  at System.Linq.Enumerable.FirstOrDefault[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0003e] in <63992662b765477a898ef49cdcc99ee2>:0 
  at LiteDB.LiteCollection`1[T].FindOne (System.Linq.Expressions.Expression`1[TDelegate] predicate) [0x00018] in <443e7085ca5f45b79ebe745a00233d33>:0 
  at TS3AudioBot.History.HistoryManager.FindByUniqueId (System.String uniqueId) [0x0008a] in <487b5d3c9c294ec09e87f2ea1773ad1b>:0 
  at TS3AudioBot.History.HistoryManager.Store (TS3AudioBot.History.HistorySaveData saveData) [0x00029] in <487b5d3c9c294ec09e87f2ea1773ad1b>:0 
  at TS3AudioBot.History.HistoryManager.LogAudioResource (TS3AudioBot.History.HistorySaveData saveData) [0x00000] in <487b5d3c9c294ec09e87f2ea1773ad1b>:0 
  at TS3AudioBot.PlayManager.Play (TS3Client.Messages.ClientData invoker, TS3AudioBot.ResourceFactories.PlayResource play, TS3AudioBot.MetaData meta) [0x000bc] in <487b5d3c9c294ec09e87f2ea1773ad1b>:0 
  at TS3AudioBot.PlayManager.Play (TS3Client.Messages.ClientData invoker, TS3AudioBot.ResourceFactories.AudioResource ar, TS3AudioBot.MetaData meta) [0x0003b] in <487b5d3c9c294ec09e87f2ea1773ad1b>:0 
  at TS3AudioBot.PlayManager.Play (TS3Client.Messages.ClientData invoker, TS3AudioBot.PlaylistItem item) [0x000c9] in <487b5d3c9c294ec09e87f2ea1773ad1b>:0 
  at TS3AudioBot.PlayManager.Next (TS3Client.Messages.ClientData invoker) [0x00020] in <487b5d3c9c294ec09e87f2ea1773ad1b>:0 
  at TS3AudioBot.PlayManager.SongStoppedHook (System.Object sender, TS3AudioBot.SongEndEventArgs e) [0x0003c] in <487b5d3c9c294ec09e87f2ea1773ad1b>:0 
  at TS3AudioBot.AudioFramework.OnResourceEnd (System.Boolean val) [0x0001a] in <487b5d3c9c294ec09e87f2ea1773ad1b>:0 
  at TS3AudioBot.AudioFramework.<AudioFramework>m__0 (System.Object s, System.EventArgs e) [0x00000] in <487b5d3c9c294ec09e87f2ea1773ad1b>:0 
  at TS3AudioBot.Ts3Full.AudioSend () [0x000c2] in <487b5d3c9c294ec09e87f2ea1773ad1b>:0 
  at TS3AudioBot.Helper.TickPool.Tick () [0x00072] in <487b5d3c9c294ec09e87f2ea1773ad1b>:0 
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00017] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x0008d] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00031] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Threading.ThreadHelper.ThreadStart () [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0 
[04:21:07]   Info: Closing Mediaplayer...
[04:21:07]  Debug: AF stop old
[04:21:07]   Info: Closing QueryConnection...
[04:21:07]   Info: Closing QueryConnection...

Program Crash in BobController

SendMessageRaw might crash due to a nullptr of bobClient. The metod SendMessage however does check for null.

Crash log:

[22:02:53]  Debug: BC sending to bobC: whisper channel add 4
[22:02:53]  Error: Critical program failure: System.ArgumentNullException: Argument cannot be null.
Parameter name: targetClient
  at TeamSpeak3QueryApi.Net.Specialized.TeamSpeakClient.SendMessage (System.String message, TeamSpeak3QueryApi.Net.Specialized.Responses.GetClientsInfo targetClient) [0x00000] in <filename unknown>:0
  at TS3AudioBot.BobController+<SendMessageRaw>c__async0.MoveNext () [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <filename unknown>:0
  at TS3AudioBot.BobController+<SendQueue>c__async1.MoveNext () [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <filename unknown>:0
  at TS3AudioBot.BobController+<AwaitBobConnect>c__async3.MoveNext () [0x00000] in <filename unknown>:0

History manager bugs

  • The history command doesn't answer when asking for about 70+ songs
  • Names still aren't displayed

The sourcearray is not long enough

This error occures sometimes:

{"Das Quellarray ist nicht lang genug. รœberprรผfen Sie srcIndex, die Lรคnge und die Untergrenze des Arrays."}
	bei System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
   bei System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length)
   bei TS3Client.Full.Ts3Crypt.ProcessInit1(Byte[] data) in F:\File\Dokumente\Visual Studio 2015\Projects\TS3\3\TS3AudioBot-develop\TS3Client\Full\Ts3Crypt.cs:Zeile 244.
   bei TS3Client.Full.Ts3FullClient.NetworkLoop() in F:\File\Dokumente\Visual Studio 2015\Projects\TS3\3\TS3AudioBot-develop\TS3Client\Full\Ts3FullClient.cs:Zeile 126.
   bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   bei System.Threading.ThreadHelper.ThreadStart()

Needs a proper tutorial how to set the bot up

  • Nuget restore on project
  • Assign correct servergroups to the bot/query (reference: #29 (comment))
  • change settings with sqlite3 not needed anymore
  • update the command list
  • add a little introduction into the command chaining and basic stuff
  • More introduction to playlists
  • More introduction to history
  • A hint to !settings
  • Maybe an overview of the most useful comments

Debug: 525: the command failed to execute: client is modified (missing permission:-1)

[20:54:32]   Info: [============ TS3AudioBot started =============]
[20:54:32]   Info: [=== Date:        Tuesday, February 7, 2017 ===]
[20:54:32]   Info: [=== Time:                       8:54:32 PM ===]
[20:54:32]   Info: [==============================================]
[20:54:32]   Info: [============ Initializing Commands ===========]
[20:54:32]   Info: [============ Initializing Modules ============]
[20:54:32]   Info: Found old history database vesion, upgrading now.
[20:54:32]   Info: [=========== Initializing Factories ===========]
[20:54:32]   Info: [=========== Registering callbacks ============]
[20:54:32]   Info: [================= Finalizing =================]
[20:54:32]   Info: [============== Connected & Done ==============]
[20:54:33]  Debug: 525: the command failed to execute: client is modified (missing permission:-1)
[20:54:38]  Error: Critical program failure!. Exception:
 MSG: Cannot access a disposed object.
Object name: 'System.Net.Sockets.UdpClient'.
TYPE:ObjectDisposedException
STACK:  at System.Net.Sockets.UdpClient.CheckDisposed () [0x00016] in <5071a6e4a4564e19a2eda0f53e42f9bd>:0
  at System.Net.Sockets.UdpClient.Send (System.Byte[] dgram, System.Int32 bytes) [0x00000] in <5071a6e4a4564e19a2eda0f53e42f9bd>:0
  at TS3Client.Full.PacketHandler.SendRaw (TS3Client.Full.OutgoingPacket packet) [0x0001d] in <99f01da4df394df7bb7885b3d01b460f>:0
  at TS3Client.Full.PacketHandler.ResendLoop () [0x000cf] in <99f01da4df394df7bb7885b3d01b460f>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00017] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Ob$
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object sta$
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object sta$
  at System.Threading.ThreadHelper.ThreadStart () [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0

[20:54:38]  Error: Critical program failure!. Exception:
 MSG: A connection attempt failed because the connected party did not properly respondafter a period of time, or established connection failed because conne$
TYPE:SocketException
STACK:  at System.Net.Sockets.Socket.ReceiveFrom_nochecks_exc (System.Byte[] buf, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags fla$
  at System.Net.Sockets.Socket.ReceiveFrom (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags socketFlags, System$
  at System.Net.Sockets.Socket.ReceiveFrom (System.Byte[] buffer, System.Net.EndPoint& remoteEP) [0x0000d] in <5071a6e4a4564e19a2eda0f53e42f9bd>:0
  at System.Net.Sockets.UdpClient.Receive (System.Net.IPEndPoint& remoteEP) [0x00014] in <5071a6e4a4564e19a2eda0f53e42f9bd>:0
  at TS3Client.Full.PacketHandler.FetchPacket () [0x000af] in <99f01da4df394df7bb7885b3d01b460f>:0
  at TS3Client.Full.Ts3FullClient.NetworkLoop () [0x00010] in <99f01da4df394df7bb7885b3d01b460f>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00017] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Ob$
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object sta$
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object sta$
  at System.Threading.ThreadHelper.ThreadStart () [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0

[20:54:38]   Info: Exiting...


Bot timeout crash

From #42 (comment):

@Splamy I get this error after 5 hours without someone listening the bot.

[10:32:16]  Debug: 1804: the command failed to execute: no whisper targets found (missing permission:-1)
[10:32:16]  Debug: 1804: the command failed to execute: no whisper targets found (missing permission:-1)
[10:32:16]  Debug: 1804: the command failed to execute: no whisper targets found (missing permission:-1)
[10:32:17]  Debug: 1804: the command failed to execute: no whisper targets found (missing permission:-1)
[10:32:17]  Debug: 1804: the command failed to execute: no whisper targets found (missing permission:-1)
[10:33:35]Warning: TH Web error: [403] Forbidden
[10:33:35]  Debug: YT Ruined!
[10:33:38]  Debug: YT Saved!
[10:33:38]  Debug: AF stop old
[10:33:38]  Debug: AF ar start: Youtube ID:GX6aFoY8QNk
[10:33:38]  Debug: AF set volume: 5
[10:33:43]  Error: Critical program failure! Logs will follow.
[10:33:43]  Error: Critical program failure! Logs will follow.
[10:33:43]  Error: MSG: A connection attempt failed because the connected party did not properly respondafter a period of time, or established connection failed because connected host has failed to respond
TYPE:SocketException
STACK:  at System.Net.Sockets.Socket.ReceiveFrom_nochecks_exc (System.Byte[] buf, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags flags, System.Net.EndPoint& remote_end, System.Boolean throwOnError, System.Int32& error) [0x00076] in <bd46d4d4f7964dfa9beea098499ab597>:0 
  at System.Net.Sockets.Socket.ReceiveFrom (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint& remoteEP) [0x00029] in <bd46d4d4f7964dfa9beea098499ab597>:0 
  at System.Net.Sockets.Socket.ReceiveFrom (System.Byte[] buffer, System.Net.EndPoint& remoteEP) [0x0000d] in <bd46d4d4f7964dfa9beea098499ab597>:0 
  at System.Net.Sockets.UdpClient.Receive (System.Net.IPEndPoint& remoteEP) [0x00014] in <bd46d4d4f7964dfa9beea098499ab597>:0 
  at TS3Client.Full.PacketHandler.FetchPacket () [0x000af] in <423360fa41334eb8862aba22f08b665b>:0 
  at TS3Client.Full.Ts3FullClient.NetworkLoop () [0x00010] in <423360fa41334eb8862aba22f08b665b>:0 
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00017] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x0008d] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00031] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Threading.ThreadHelper.ThreadStart () [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0 
[10:33:43]  Error: MSG: Cannot access a disposed object.
Object name: 'System.Net.Sockets.UdpClient'.
TYPE:ObjectDisposedException
STACK:  at System.Net.Sockets.UdpClient.CheckDisposed () [0x00016] in <bd46d4d4f7964dfa9beea098499ab597>:0 
  at System.Net.Sockets.UdpClient.Send (System.Byte[] dgram, System.Int32 bytes) [0x00000] in <bd46d4d4f7964dfa9beea098499ab597>:0 
  at TS3Client.Full.PacketHandler.SendRaw (TS3Client.Full.OutgoingPacket packet) [0x0001d] in <423360fa41334eb8862aba22f08b665b>:0 
  at TS3Client.Full.PacketHandler.ResendLoop () [0x000cf] in <423360fa41334eb8862aba22f08b665b>:0 
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00017] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x0008d] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00031] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Threading.ThreadHelper.ThreadStart () [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0 

VPS

This bot works fine a vps?

Cant play a playlist

Well the bot works fine, but when I try to play a playlist I get this error:

[00:09:23]  Debug: MB Got message from Akira: !list play
[00:09:24]Warning: TH Web error: [403] Forbidden

Edit: It's a problem with Youtube-DL?

# youtube-dl -U
youtube-dl is up-to-date (2016.08.01)

Error in Config File

I get this error:

ts3music@ts3:~/TS3AudioBot/TS3AudioBot/bin/Release$ mono TS3AudioBot.exe
Config file does not exist...
Please enter the default volume a song should start with: .5
Input parse of AudioFramework::defaultVolume failed [Ignoring]
Please enter the maximum volume a normal user can request:
Input parse of AudioFramework::maxUserVolume failed [Ignoring]
Please enter the address of the TeamSpeak3 server: ts3.server.com
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
  at TS3AudioBot.Helper.ConfigFile+NormalConfigFile.WriteKey (System.String key, System.String value) [0x0003c] in <126ac99f74ea4025abdbab674c46b9e4>:0
  at TS3AudioBot.Helper.ConfigFile.WriteValueToConfig (System.String entryName, System.Object value) [0x0000d] in <126ac99f74ea4025abdbab674c46b9e4>:0
  at TS3AudioBot.Helper.ConfigFile.GetDataStruct[T] (System.String associatedClass, System.Boolean defaultIfPossible) [0x0011a] in <126ac99f74ea4025abdbab674c46b9e4>:0
  at TS3AudioBot.MainBot.InitializeBot () [0x00034] in <126ac99f74ea4025abdbab674c46b9e4>:0
  at TS3AudioBot.MainBot.Main (System.String[] args) [0x0003d] in <126ac99f74ea4025abdbab674c46b9e4>:0

More log data

Add date to the log output
Add a second log with stacktrace

-

I got it to work, thanks :)

New API Interface

  • connect / disconnect (via add:port)
  • play / stop (with link)
  • change name
  • api token ?
  • multiple clients on same instance
  • Activate / Deactivate plugins for each server
  • api request for basic client data (dbid, clientid)
  • Anonymous/Admin key
  • !! ApiKey should not be postet publicly

Add more history features

  • Remove entries
  • Clean history from defective links
  • Cleanup history file
  • rename entries
  • Option to fill up deleted entries
  • Trim songs

Youtube-DL failed

This is normal? The song can play correctly but I get this message:

[19:07:57]Warning: TH Web error: [403] Forbidden
[19:07:57]  Debug: YT Ruined!
[19:07:59]  Error: youtube-dl failed to load the resource:
WARNING: unable to extract uploader nickname

Error call Stack:
TS3AudioBot.Helper.R`1[TS3AudioBot.ResourceFactories.PlayResource] YoutubeDlWrapped(TS3AudioBot.ResourceFactories.AudioResource)@0
TS3AudioBot.Helper.R`1[TS3AudioBot.ResourceFactories.PlayResource] GetResourceById(TS3AudioBot.ResourceFactories.AudioResource)@0
TS3AudioBot.Helper.R`1[TS3AudioBot.ResourceFactories.PlayResource] Load(TS3AudioBot.ResourceFactories.AudioResource)@0
TS3AudioBot.Helper.R Play(TS3AudioBot.InvokerData, TS3AudioBot.ResourceFactories.AudioResource, TS3AudioBot.MetaData)@0
TS3AudioBot.Helper.R Play(TS3AudioBot.InvokerData, TS3AudioBot.PlaylistItem)@0
TS3AudioBot.Helper.R Next(TS3AudioBot.InvokerData)@0
Void SongStoppedHook(System.Object, TS3AudioBot.SongEndEventArgs)@0
Void OnResourceEnd(Boolean)@0
Void <AudioFramework>m__0(System.Object, System.EventArgs)@0
Void AudioSend()@0
Void Tick()@0
Void ThreadStart_Context(System.Object)@0
Void RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)@0
Void Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)@0
Void Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)@0
Void ThreadStart()@0 T:TickPool
[19:07:59]Warning: TH Web error: [403] Forbidden
[19:07:59]  Debug: YT Ruined!
[19:08:01]  Debug: YT Saved!
[19:08:01]  Debug: AF stop old
[19:08:01]  Debug: AF ar start: Youtube ID:euCqAq6BRa4
[19:08:01]  Debug: AF set volume: 5

btw, nice job for the fixes!

Generator.cs TypeNameConflict

bei System.Reflection.Emit.ModuleBuilder.CheckTypeNameConflict(String strTypeName, Type enclosingType)
Occurs when starting multible bots

  Doppelter Typenname in einer Assembly. - Duplicate type name in an assembly.
 bei System.Reflection.Emit.AssemblyBuilderData.CheckTypeNameConflict(String strTypeName, TypeBuilder enclosingType)
   bei System.Reflection.Emit.TypeBuilder.Init(String fullname, TypeAttributes attr, Type parent, Type[] interfaces, ModuleBuilder module, PackingSize iPackingSize, Int32 iTypeSize, TypeBuilder enclosingType)
   bei System.Reflection.Emit.ModuleBuilder.DefineType(String name, TypeAttributes attr, Type parent)
   bei TS3Client.Messages.Generator.Generate(Type backingInterface, Boolean notifyProp) in F:\File\Dokumente\Visual Studio 2015\Projects\TS3\3\TS3AudioBot-develop\TS3Client\Messages\Generator.cs:Zeile 66.
   bei TS3Client.Messages.Generator.Activate(Type backingInterface, Boolean notifyProp) in F:\File\Dokumente\Visual Studio 2015\Projects\TS3\3\TS3AudioBot-develop\TS3Client\Messages\Generator.cs:Zeile 51.
   bei TS3Client.Messages.Generator.ActivateNotification(Type t) in F:\File\Dokumente\Visual Studio 2015\Projects\TS3\3\TS3AudioBot-develop\TS3Client\Messages\Generator.cs:Zeile 39.
   bei TS3Client.CommandDeserializer.<>c__DisplayClass4_0.<GenerateNotification>b__0(String msg) in F:\File\Dokumente\Visual Studio 2015\Projects\TS3\3\TS3AudioBot-develop\TS3Client\CommandDeserializer.cs:Zeile 106.
   bei System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   bei System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   bei TS3Client.Ts3BaseClient.<>c__DisplayClass46_0.<InvokeEvent>b__3() in F:\File\Dokumente\Visual Studio 2015\Projects\TS3\3\TS3AudioBot-develop\TS3Client\Ts3BaseClient.cs:Zeile 177.
   bei TS3Client.DoubleThreadEventDispatcher.EnterEventLoop() in F:\File\Dokumente\Visual Studio 2015\Projects\TS3\3\TS3AudioBot-develop\TS3Client\EventDispatcher.cs:Zeile 75.
   bei TS3Client.Ts3BaseClient.EnterEventLoop() in F:\File\Dokumente\Visual Studio 2015\Projects\TS3\3\TS3AudioBot-develop\TS3Client\Ts3BaseClient.cs:Zeile 113.
   bei TS3Client.Full.Ts3FullClient.<StartLoopThread>b__10_0() in F:\File\Dokumente\Visual Studio 2015\Projects\TS3\3\TS3AudioBot-develop\TS3Client\Full\Ts3FullClient.cs:Zeile 39.

System.InvalidOperationException: Compressed packet is too large

Unhandled Exception: System.InvalidOperationException: Compressed packet is too large
   at TS3Client.Full.PacketHandler.ReceiveCommand(IncomingPacket packet) in C:\Projects\TS3AudioBot-master\TS3Client\Full\PacketHandler.cs:line 337
   at TS3Client.Full.PacketHandler.FetchPacket() in C:\Projects\TS3AudioBot-master\TS3Client\Full\PacketHandler.cs:line 229
   at TS3Client.Full.Ts3FullClient.NetworkLoop() in C:\Projects\TS3AudioBot-master\TS3Client\Full\Ts3FullClient.cs:line 109
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

This is possibly thrown on large TeamSpeak's with high user traffic and alot of channels. Since I was instantiating a new client for each bot to ensure no of the bots were affecting each other. After 150~ bots this crash would be encountered.

Add Webinterface

TODO:

  • Add command to get a website link
  • Create a link somewhere which automatically add the current user token https://test.de/?token=sadfasdf:asssdfg

Critical program failure

I think its a problem when trying to connect, both ports UDP and TCP are open :
PROTOCOL='UDP' PORT='9987'
PROTOCOL='TCP' PORT='10011'

[16:20:15]   Info: [============ TS3AudioBot started =============]
[16:20:15]   Info: [=== Date:      Wednesday, 28 December 2016 ===]
[16:20:15]   Info: [=== Time:                         16:20:15 ===]
[16:20:15]   Info: [==============================================]
[16:20:15]   Info: [============ Initializing Commands ===========]
[16:20:15]   Info: [============ Initializing Modules ============]
[16:20:15]   Info: Devupdate disabled
[16:20:15]   Info: [=========== Initializing Factories ===========]
[16:20:15]   Info: [=========== Registering callbacks ============]
[16:20:15]   Info: [================= Finalizing =================]
[16:20:15]  Error: Critical program failure! Logs will follow.
[16:20:15]  Error: MSG: The requested address is not valid in this context
TYPE:SocketException
STACK:  at System.Net.Sockets.Socket.Bind (System.Net.EndPoint localEP) [0x0004c] in <bd46d4d4f7964dfa9beea098499ab597>:0 
  at System.Net.EndPointListener..ctor (System.Net.HttpListener listener, System.Net.IPAddress addr, System.Int32 port, System.Boolean secure) [0x0004a] in <bd46d4d4f7964dfa9beea098499ab597>:0 
  at System.Net.EndPointManager.GetEPListener (System.String host, System.Int32 port, System.Net.HttpListener listener, System.Boolean secure) [0x000be] in <bd46d4d4f7964dfa9beea098499ab597>:0 
  at System.Net.EndPointManager.AddPrefixInternal (System.String p, System.Net.HttpListener listener) [0x00064] in <bd46d4d4f7964dfa9beea098499ab597>:0 
  at System.Net.EndPointManager.AddListener (System.Net.HttpListener listener) [0x00030] in <bd46d4d4f7964dfa9beea098499ab597>:0 
[16:20:15]  Error: Critical program failure! Logs will follow.
[16:20:15]  Error: MSG: The requested address is not valid in this context
TYPE:SocketException
STACK:  at System.Net.Sockets.Socket.Bind (System.Net.EndPoint localEP) [0x0004c] in <bd46d4d4f7964dfa9beea098499ab597>:0 
  at System.Net.EndPointListener..ctor (System.Net.HttpListener listener, System.Net.IPAddress addr, System.Int32 port, System.Boolean secure) [0x0004a] in <bd46d4d4f7964dfa9beea098499ab597>:0 
  at System.Net.EndPointManager.GetEPListener (System.String host, System.Int32 port, System.Net.HttpListener listener, System.Boolean secure) [0x000be] in <bd46d4d4f7964dfa9beea098499ab597>:0 
  at System.Net.EndPointManager.RemovePrefixInternal (System.String prefix, System.Net.HttpListener listener) [0x00046] in <bd46d4d4f7964dfa9beea098499ab597>:0 
  at System.Net.EndPointManager.RemoveListener (System.Net.HttpListener listener) [0x00028] in <bd46d4d4f7964dfa9beea098499ab597>:0 
  at System.Net.HttpListener.Close (System.Boolean force) [0x00006] in <bd46d4d4f7964dfa9beea098499ab597>:0 
  at System.Net.HttpListener.System.IDisposable.Dispose () [0x0000c] in <bd46d4d4f7964dfa9beea098499ab597>:0 
  at TS3AudioBot.WebInterface.WebDisplay.EnterWebLoop () [0x0012b] in <605a4c2755b747db934570f8a0b740bd>:0 
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00017] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x0008d] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00031] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Threading.ThreadHelper.ThreadStart () [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0 

Config:

AudioFramework::defaultVolume=1
AudioFramework::maxUserVolume=1
QueryConnection::host=ts3.server.com
QueryConnection::port=9987
QueryConnection::identity=MHADAgeAAgEgAiEAtjA3tMmW3t4B6LsaI4xZop0Vp3Mvz4+h7oD0a6TXT/ICIQDHRprylLcHWJmxuJPY0Nyu33FPqhdjxmi6nkWo5iktiQIhAPRUVX7ad2LMiGY45FWU5gn6nWWEWOP7XXcaKuhQTwMN
QueryConnection::identityoffset=532
QueryConnection::ffmpegpath=ffmpeg
HistoryManager::historyFile=test.txt
HistoryManager::fillDeletedIds=True
PluginManager::PluginPath=Plugins
PlaylistManager::playlistPath=Playlists
YoutubeFactory::apiKey=AIzaSyBOqG5LUbGSkBfRUoYfUUea37-5xlEyxNs
YoutubeFactory::youtubedlpath=
MainBot::logFile=log_ts3audiobot
MainBot::adminGroupId=452

Questions

How do I connect if the server has a port number?

Am I suppose to put the query port or regular port for QueryConnection::host=

Bot Timeout

I get this timeout:

[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
  at TS3AudioBot.Ts3Full.AudioSend () [0x0007a] in <f39f29301a564c90a90ac1e149d9b50a>:0
  at TS3AudioBot.Helper.TickPool.Tick () [0x00072] in <f39f29301a564c90a90ac1e149d9b50a>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00017] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x0008d] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00031] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Threading.ThreadHelper.ThreadStart () [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
[07:35:55]  Debug: Bot disconnected. Reason: Timeout
[07:35:55]Warning: -1: the command failed to execute: Connection Closed (missing permission:-1)
[07:35:55]   Info: Exiting...
[07:35:55]   Info: Closing Mediaplayer...
[07:35:55]  Debug: AF stop old
[07:35:56]Warning: -1: the command failed to execute: Connection closed (missing permission:-1)
[07:35:56]   Info: Closing QueryConnection...
[07:35:56]   Info: Closing QueryConnection...

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.