station

package
v0.0.0-...-570cedc Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotYoutubeLink = errors.New("not a youtube link")
)

Functions

func ExtractYoutubeID

func ExtractYoutubeID(message string) (id string, err error)

ExtractYoutubeID from message

Types

type Playlist

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

func NewPlaylist

func NewPlaylist() *Playlist

func (*Playlist) Add

func (p *Playlist) Add(link string)

func (*Playlist) Delete

func (p *Playlist) Delete(link string)

func (*Playlist) Has

func (p *Playlist) Has(link string) bool
func (p Playlist) Links() []string

func (*Playlist) Poll

func (p *Playlist) Poll() (link string)

Poll return the fist link, if len == 0 return ""

func (*Playlist) Shuffle

func (p *Playlist) Shuffle() (link string)

func (*Playlist) Size

func (p *Playlist) Size() int

type Station

type Station struct {
	*slack.Client
	// contains filtered or unexported fields
}

Station of #music channel

func New

func New(slackToken string, channelID string) (station *Station)

New return station by slack token and channel

func (*Station) History

func (s *Station) History(ctx context.Context) (playlist *Playlist, err error)

func (*Station) OnAir

func (s *Station) OnAir() (func(ctx context.Context, title string, youtubeUrl string), func())

func (*Station) SetBookmark

func (s *Station) SetBookmark(title string) error

func (*Station) Watch

func (s *Station) Watch(ctx context.Context) (playlist *Playlist, err error)

Jump to

Keyboard shortcuts

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