VoiceConnection

public class VoiceConnection: Gateway, Eventable

Voice Connection class that handles connection to voice server

  • Guild that this voice connection is server

    Declaration

    Swift

    public let guildId: Snowflake
  • Whether or not the voice connection is playing something

    Declaration

    Swift

    public var isPlaying = false
  • Event listeners

    Declaration

    Swift

    public var listeners = [Event: [(Any) -> ()]]()
  • Used to tell encoder to close the write pipe

    Declaration

    Swift

    public func finish()
  • Plays a file

    Declaration

    Swift

    public func play(_ location: String, volume: Int = 100)
  • Gets a process’ info and sets its output to encoder’s writePipe, then launches it

    Declaration

    Swift

    public func play(_ process: Process, volume: Int = 100)
  • Plays a youtube video/youtube-dl related sites

    Declaration

    Swift

    public func play(_ youtube: Youtube, volume: Int = 100)