music

package
v0.0.0-...-e3af7b5 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmbedGenerator

func EmbedGenerator(embed *messages.EmbedBuilder, info *Music, author *discordgo.User, title string, color int)

func FormatTime

func FormatTime(duration int) string

Types

type Music

type Music struct {
	Title         string  `json:"title"`
	Extractor     string  `json:"extractor"`
	Uploader      string  `json:"uploader"`
	Thumbnail     string  `json:"thumbnail"`
	Type          string  `json:"_type"`
	Entries       []Music `json:"entries"`
	URL           string  `json:"webpage_url"`
	Duration      int     `json:"duration"`
	IsLive        bool    `json:"is_live"`
	RequesterID   string
	RequesterName string
}

func GetInfo

func GetInfo(url string) (*Music, error)

type MusicModule

type MusicModule struct {
	Player *MusicPlayer
}

func (MusicModule) GetName

func (MusicModule) GetName() string

func (*MusicModule) Init

func (m *MusicModule) Init(server *server.Server) error

type MusicPlayer

type MusicPlayer struct {
	IsPlaying bool

	CurrentlyPlaying *Music
	// contains filtered or unexported fields
}

func (*MusicPlayer) AddMusic

func (p *MusicPlayer) AddMusic(url string, user *discordgo.User) (*Music, error)

func (*MusicPlayer) IsValidExtractor

func (p *MusicPlayer) IsValidExtractor(m *Music) bool

func (*MusicPlayer) PopNext

func (p *MusicPlayer) PopNext() (*Music, error)

func (*MusicPlayer) Pump

func (p *MusicPlayer) Pump()

TODO: It might be better if this is moved into another thread that gets notified via a channel

func (*MusicPlayer) Skip

func (p *MusicPlayer) Skip()

type PlayCommand

type PlayCommand struct {
	// contains filtered or unexported fields
}

func (PlayCommand) Action

func (p PlayCommand) Action(m *discordgo.MessageCreate, args []string, creator *messages.MessageCreator) error

func (PlayCommand) Check

func (PlayCommand) Check(cmd string) bool

func (PlayCommand) GetHelpPageEntry

func (PlayCommand) GetHelpPageEntry() commands.HelpPageEntry

func (PlayCommand) ShouldRemoveOriginal

func (PlayCommand) ShouldRemoveOriginal() bool

type SkipCommand

type SkipCommand struct {
	// contains filtered or unexported fields
}

func (SkipCommand) Action

func (c SkipCommand) Action(m *discordgo.MessageCreate, args []string, creator *messages.MessageCreator) error

func (SkipCommand) Check

func (SkipCommand) Check(cmd string) bool

func (SkipCommand) GetHelpPageEntry

func (SkipCommand) GetHelpPageEntry() commands.HelpPageEntry

func (SkipCommand) ShouldRemoveOriginal

func (SkipCommand) ShouldRemoveOriginal() bool

Jump to

Keyboard shortcuts

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