Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Connection ¶
type Connection struct { GuildID string ChannelID string EncodeOpts *dca.EncodeOptions VoiceConnection *discordgo.VoiceConnection Queue []*QueueItem Mutex *sync.Mutex }
Connection is the type for a music connection to Discord.
func NewConnection ¶
func NewConnection(voice *discordgo.VoiceConnection, opts *dca.EncodeOptions) *Connection
NewConnection will return a new Connection struct.
func (*Connection) AddYouTubeVideo ¶
func (c *Connection) AddYouTubeVideo(url string) (*ytdl.VideoInfo, error)
AddYouTubeVideo will add the download URL for a YouTube video to the queue.
func (*Connection) Close ¶
func (c *Connection) Close() error
Close closes the VoiceConnection, stops sending speaking packet, and closes the EncodeSession.
func (*Connection) StreamMusic ¶
func (c *Connection) StreamMusic() error
StreamMusic will create a new encode session from the current DownloadURL and stream that to the VoiceConnection. Will block until queue is empty.
Click to show internal directories.
Click to hide internal directories.