music

package
v0.0.0-...-abf6750 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StoppedState = iota
	DestroyedState
	PausedState
	PlayingState
)

Variables

View Source
var (
	TimerTime = 3 * time.Minute
)

Functions

This section is empty.

Types

type Player

type Player struct {
	*sync.Mutex
	*core.BasicContext

	Voicy *voicy.Session

	Timer *time.Timer
	State int

	Current *RequestedSong
	Queue   []*RequestedSong

	GuildID         discord.GuildID
	VoiceID, TextID discord.ChannelID
}

func GetOrCreatePlayer

func GetOrCreatePlayer(guildID discord.GuildID, textID, voiceID discord.ChannelID) *Player

func GetPlayer

func GetPlayer(guildID discord.GuildID) *Player

func NewPlayer

func NewPlayer(guildID discord.GuildID, textID, voiceID discord.ChannelID) *Player

func (*Player) AddSong

func (p *Player) AddSong(requester *discord.User, shuffle bool, songs ...*music.Song)

func (*Player) Pause

func (p *Player) Pause()

func (*Player) Play

func (p *Player) Play()

func (*Player) Resume

func (p *Player) Resume()

func (*Player) Shuffle

func (p *Player) Shuffle()

func (*Player) Skip

func (p *Player) Skip()

func (*Player) Stop

func (p *Player) Stop(schedule bool)

type RequestedSong

type RequestedSong struct {
	*music.Song
	Requester   *discord.User `json:"requester"`
	RequestedAt time.Time     `json:"requestedAt"`
}

Jump to

Keyboard shortcuts

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