lavalink

package
v0.0.0-...-b62c219 Latest Latest
Warning

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

Go to latest
Published: May 12, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectOptions

type ConnectOptions struct {
	Name       string
	Endpoint   string
	Password   string
	ShardCount int
	UserID     uint64
	Dialer     *websocket.Dialer
}

ConnectOptions are the options used when connecting to the Lavalink server

type Connection

type Connection struct {
	Name string
	// contains filtered or unexported fields
}

Connection represents a WebSocket connection to a Lavalink server

func Connect

func Connect(opts ConnectOptions) (*Connection, error)

Connect this node to the given node

func (*Connection) Destroy

func (c *Connection) Destroy(guildID uint64) error

Destroy destroys this player

func (*Connection) Pause

func (c *Connection) Pause(guildID uint64, pause bool) error

Pause this guild

func (*Connection) Play

func (c *Connection) Play(guildID uint64, track string, start, end int) error

Play a track

func (*Connection) Read

func (c *Connection) Read(p []byte) (int, error)

func (*Connection) ReadJSON

func (c *Connection) ReadJSON(p interface{}) error

ReadJSON into the value pointed at by p

func (*Connection) Seek

func (c *Connection) Seek(guildID uint64, position int) error

Seek to a specific point in the current track

func (*Connection) Send

func (c *Connection) Send(d interface{}) error

Send JSON to this connection

func (*Connection) SetEqualizer

func (c *Connection) SetEqualizer(guildID uint64, bands []types.EqualizerBand) error

SetEqualizer sets the equalizer

func (*Connection) SetVolume

func (c *Connection) SetVolume(guildID uint64, volume int) error

SetVolume sets the volume

func (*Connection) Stop

func (c *Connection) Stop(guildID uint64) error

Stop this guild

func (*Connection) Store

func (c *Connection) Store(store store.Lavalink) (err error)

Store consumes events from Lavalink and stores them in the given cache. Since this reads events from the WebSocket, no other goroutines should attempt to read.

func (*Connection) VoiceUpdate

func (c *Connection) VoiceUpdate(guildID uint64, sessionID string, event types.VoiceServerUpdate) error

VoiceUpdate sends a voiceUpdate packet to Lavalink

func (*Connection) Write

func (c *Connection) Write(p []byte) (int, error)

type HTTP

type HTTP struct {
	Client   *http.Client
	Endpoint string
	Password string
}

HTTP handles HTTP requests to Lavalink

func (*HTTP) DecodeTrack

func (h *HTTP) DecodeTrack(identifier string) (track types.TrackInfo, err error)

DecodeTrack from the given endpoint

func (*HTTP) DecodeTracks

func (h *HTTP) DecodeTracks(identifiers []string) (tracks []types.TrackInfo, err error)

DecodeTracks from the given endpoint

func (*HTTP) DoJSON

func (h *HTTP) DoJSON(method, path string, d interface{}, genQuery func(q url.Values)) (res *http.Response, err error)

DoJSON performs a JSON HTTP request to the Lavalink node

func (*HTTP) LoadTrack

func (h *HTTP) LoadTrack(identifier string) (track types.TrackResponse, err error)

LoadTrack from the given endpoint

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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