Documentation
¶
Index ¶
Constants ¶
View Source
const (
QueuePageSize = 10
)
Variables ¶
View Source
var ( ErrBadFormat = errors.New("bad format") ErrInOtherChannel = errors.New("bot is in a different voice channel") ErrMusicNotFound = errors.New("music not found") ErrNotPlaying = errors.New("not playing in any voice channels") ErrQueueNotFound = errors.New("queue not found") ErrQueueOutOfBounds = errors.New("queue out of bounds") )
Functions ¶
This section is empty.
Types ¶
type MusicRepository ¶
type MusicSource ¶ added in v1.2.0
type MusicSource uint
const ( MusicSourceSpotifyPlaylist MusicSource = iota MusicSourceSpotifyTrack MusicSourceYouTubeVideo MusicSourceSearch )
func (MusicSource) String ¶ added in v1.2.0
func (s MusicSource) String() string
type MusicUseCase ¶
type PlayerAction ¶
type PlayerAction uint
const ( PlayerActionPlay PlayerAction = iota PlayerActionSkip PlayerActionStop PlayerActionKick )
type PlayerStatus ¶
type PlayerStatus uint
const ( PlayerStatusPlaying PlayerStatus = iota PlayerStatusStopped PlayerStatusUninitialized )
type PlayerUseCase ¶
type PlayerUseCase interface { Create(s *discordgo.Session, vch, sch *discordgo.Channel, q *Queue) (*Player, error) Get(guildID string) (*Player, error) GetAll() []*Player Play(p *Player) error Skip(p *Player) error Stop(p *Player) error UpdateNPMessage(s *discordgo.Session, p *Player, q *Queue, queuePage int, toggleQueue, keepLast bool) error Kick(s *discordgo.Session, p *Player, q *Queue) error Count() int TotalPlaytime() time.Duration }
type Queue ¶
type Queue struct { GuildID string ActiveTracks []*Music CurrentPos int Loop LoopMode LastQueueMessageID string LastPage int Shuffle ShuffleMode OriginalTracks []*Music }
func (*Queue) GetPageItems ¶ added in v1.7.0
func (*Queue) NowPlaying ¶
type QueueRepository ¶
type QueueRepository interface { Create(guildID string) (*Queue, error) Get(guildID string) (*Queue, error) Enqueue(guildID string, music *Music) (int, error) Jump(guildID string, pos int) error Move(guildID string, from, to int) error Remove(guildID string, pos int) error SetLoopMode(guildID string, mode LoopMode) error SetShuffleMode(guildID string, mode ShuffleMode) error Clear(guildID string) error }
type QueueUseCase ¶
type QueueUseCase interface { Get(guildID string) (*Queue, error) Enqueue(q *Queue, music *Music, pos int) (int, error) Jump(q *Queue, pos int) error Move(q *Queue, from, to int) error Remove(q *Queue, pos int) error SetLoopMode(q *Queue, mode LoopMode) error SetShuffleMode(q *Queue, mode ShuffleMode) error Clear(q *Queue) error }
type ShuffleMode ¶ added in v1.8.0
type ShuffleMode uint
const ( ShuffleModeOff ShuffleMode = iota ShuffleModeOn )
func (ShuffleMode) String ¶ added in v1.8.0
func (m ShuffleMode) String() string
Click to show internal directories.
Click to hide internal directories.