player

package
v0.0.0-...-8ce17bf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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.

func (*Dispatcher) SkipTo

func (d *Dispatcher) SkipTo(gID string, pos int) (string, error)

SkipTo skips to the specified queue position.

func (*Dispatcher) Stop

func (d *Dispatcher) Stop(gID string) (string, error)

Stop stops music stream and discards the queue.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL