Discordia icon indicating copy to clipboard operation
Discordia copied to clipboard

Decouple Voice Management from main Discordia

Open JohnnyMorganz opened this issue 5 years ago • 0 comments

Currently, I am trying to get Lavalink to work with Discordia to use as an alternative voice system compared to the inbuilt Voice Management. A few issues come up during this:

  • GuildVoiceChannel:join() initiates a VoiceConnection, however this is not needed for my system, and comes with side effects. Neither opus or sodium are installed or needed, but this outputs an error in the log.
  • Initiating this VoiceConnection also causes the thread to be yielded for 10 seconds, as the VoiceConnection is not prepared by then (See https://github.com/SinisterRectus/Discordia/blob/master/libs/voice/VoiceConnection.lua#L104 and https://github.com/SinisterRectus/Discordia/blob/master/libs/containers/GuildVoiceChannel.lua#L81)
  • Can no longer rely on the success, err passed from GuildVoiceChannel:join() as it will always fail
  • A series of messages and (discordia) errors print into the console which is mainly just clutter

Essentially, GuildVoiceChannel:join() just needs to do what it says on the tin as a minimum, and initializing the internal system should be an optional extra. Further to this, in regards to the 10 second delay, would it not make sense to immediately resume the thread if either opus or sodium are not found, as there is just 10 seconds of waiting for no reason - the connection will never be prepared if they are not there.

I personally believe that the Voice integration should be an optional extra, and the management should not be loaded if it isn't required.

JohnnyMorganz avatar Jun 11 '19 16:06 JohnnyMorganz