Documentation ¶
Index ¶
Constants ¶
View Source
const ( PlaybackStatePlaying = iota PlaybackStatePaused PlaybackStateStopped )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GuildSession ¶
type GuildSession struct { GuildID string GuildName string RWMutex sync.RWMutex Queue []QueueItem // current item = index 0 VoiceConnection *discordgo.VoiceConnection VoiceChannelID string History []string // Youtube IDs MusicPlayer MusicPlayer }
GuildSession represents a guild voice session
type MusicPlayer ¶
type MusicPlayer struct { PlaybackState PlaybackState Control chan MusicPlayerAction PlaybackChannel chan []byte Volume float64 // contains filtered or unexported fields }
MusicPlayer represents a music player
func (*MusicPlayer) PlayStream ¶ added in v0.6.1
func (mp *MusicPlayer) PlayStream(stream *bufio.Reader) error
Huge thanks to https://github.com/iopred/bruxism/blob/master/musicplugin/musicplugin.go
func (*MusicPlayer) PlayURL ¶ added in v0.6.1
func (mp *MusicPlayer) PlayURL(url string) error
PlayURL play a URL to an audio/video file
func (*MusicPlayer) PlayYouTubeVideo ¶ added in v0.6.1
func (mp *MusicPlayer) PlayYouTubeVideo(youtubeURL string) error
type MusicPlayerAction ¶
type MusicPlayerAction int
MusicPlayerAction an action to be issued to MusicPlayer
const ( // MusicPlayerActionStop stop this track MusicPlayerActionStop MusicPlayerAction = iota // MusicPlayerActionPause pause this track MusicPlayerActionPause // MusicPlayerActionResume resume this track MusicPlayerActionResume )
type PlaybackState ¶ added in v0.6.1
type PlaybackState int
type QueueItem ¶
type QueueItem struct { Title string ChannelTitle string Author string VideoID string Thumbnail string }
QueueItem represents an item in the music queue
func ConvertYouTubePlaylistItem ¶
func ConvertYouTubePlaylistItem(playlistItem *youtube.PlaylistItem) QueueItem
ConvertYouTubePlaylistItem convert a YouTube playlist item into a local QueueItem model
Click to show internal directories.
Click to hide internal directories.