Documentation ¶
Index ¶
- type Dispatcher
- func (d *Dispatcher) Pause(gID string) (string, error)
- func (d *Dispatcher) Play(gID, vID, cmdID string, songs []types.Song)
- func (d *Dispatcher) Queue(gID string) []types.Song
- func (d *Dispatcher) Resume(gID string) (string, error)
- func (d *Dispatcher) Seek(gID string, seekTime int) (string, error)
- func (d *Dispatcher) Skip(gID string) (string, error)
- func (d *Dispatcher) SkipTo(gID string, pos int) (string, error)
- func (d *Dispatcher) Stop(gID string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher is the player manager that routes songs to the correct guild player.
func NewDispatcher ¶
func NewDispatcher(s *discordgo.Session, log *zap.SugaredLogger) *Dispatcher
NewDispatcher creates new player dispatcher.
func (*Dispatcher) Pause ¶
func (d *Dispatcher) Pause(gID string) (string, error)
Pause pauses currently playing track.
func (*Dispatcher) Play ¶
func (d *Dispatcher) Play(gID, vID, cmdID string, songs []types.Song)
Play adds songs to the queue of the guild player. If player doesn't exist, new one is created and launched in goroutine.
func (*Dispatcher) Queue ¶
func (d *Dispatcher) Queue(gID string) []types.Song
Queue returns titles of queued songs.
func (*Dispatcher) Resume ¶
func (d *Dispatcher) Resume(gID string) (string, error)
Resume resumes track that was playing.
func (*Dispatcher) Seek ¶
func (d *Dispatcher) Seek(gID string, seekTime int) (string, error)
Seek skips song playback to the desired time. seekTime is measured in seconds.
func (*Dispatcher) Skip ¶
func (d *Dispatcher) Skip(gID string) (string, error)
Skip skips currently playing track.
Click to show internal directories.
Click to hide internal directories.