music

package
v0.0.0-...-7e69f2d Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2017 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Skip controlMessage = iota
	Pause
	Play
	Resume
	Stop
)

Variables

View Source
var MusicHelp = []string{
	"music join -- Joins a voice channel",
	"music leave -- Leaves a voice channel",

	"music skip -- Skips a track",
	"music pause -- Pauses a track",
	"music resume -- Unpauses a track",
	"music shuffle -- Shuffles the queue.",
	"music play [song] -- Plays a track. Has to be in a voice channel. Queues it if a track is already playing.",
}

Functions

This section is empty.

Types

type Connection

type Connection struct {
	sync.Mutex

	Guild        string
	Channel      string
	MaxQueueSize int
	Queue        Tracks
	// contains filtered or unexported fields
}

type MusicPlayer

type MusicPlayer struct {
	sync.Mutex

	VoiceConnections map[string]*Connection
	// contains filtered or unexported fields
}

func NewMusicPlayer

func NewMusicPlayer(client *dgofw.DiscordClient) *MusicPlayer

func (*MusicPlayer) OnMessage

func (mp *MusicPlayer) OnMessage(m *dgofw.DiscordMessage)

type Track

type Track struct {
	AddedBy     *dgofw.DiscordUser
	ID          string `json:"id"`
	Title       string `json:"title"`
	Description string `json:"description"`
	FullTitle   string `json:"full_title"`
	Thumbnail   string `json:"thumbnail"`
	URL         string `json:"url"`
	Duration    int    `json:"duration"`
	LenMinutes  int
	LenSeconds  int
	Remaining   int
}

type Tracks

type Tracks []*Track

func (Tracks) Len

func (t Tracks) Len() int

func (Tracks) Less

func (t Tracks) Less(i, j int) bool

func (Tracks) Swap

func (t Tracks) Swap(i, j int)

Jump to

Keyboard shortcuts

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