lavaqueue

package module
v0.0.0-...-9bff396 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

README

lavaqueue-plugin

Documentation

Index

Constants

View Source
const (
	EventTypeQueueEnd lavalink.EventType = "QueueEndEvent"
)

Variables

This section is empty.

Functions

func AddQueueTracks

func AddQueueTracks(ctx context.Context, client disgolink.RestClient, sessionID string, guildID snowflake.ID, tracks []QueueTrack) error

func GetHistory

func GetHistory(ctx context.Context, client disgolink.RestClient, sessionID string, guildID snowflake.ID) ([]lavalink.Track, error)

func UpdateQueue

func UpdateQueue(ctx context.Context, client disgolink.RestClient, sessionID string, guildID snowflake.ID, queue QueueUpdate) error

Types

type LavaQueueEventListener

type LavaQueueEventListener interface {
	OnQueueEnd(player disgolink.Player, event QueueEndEvent)
}

type Plugin

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

func New

func New() *Plugin

func NewWithLogger

func NewWithLogger(logger *slog.Logger) *Plugin

func (*Plugin) EventPlugins

func (p *Plugin) EventPlugins() []disgolink.EventPlugin

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) Version

func (p *Plugin) Version() string

type Queue

type Queue struct {
	Type   QueueType        `json:"type"`
	Tracks []lavalink.Track `json:"tracks"`
}

func GetQueue

func GetQueue(ctx context.Context, client disgolink.RestClient, sessionID string, guildID snowflake.ID) (*Queue, error)

type QueueEndEvent

type QueueEndEvent struct {
	GuildID_ snowflake.ID `json:"guild_id"`
}

func (QueueEndEvent) GuildID

func (e QueueEndEvent) GuildID() snowflake.ID

func (QueueEndEvent) Op

func (QueueEndEvent) Op() lavalink.Op

func (QueueEndEvent) Type

type QueueTrack

type QueueTrack struct {
	Encoded  string           `json:"encoded"`
	UserData lavalink.RawData `json:"user_data"`
}

type QueueType

type QueueType string
const (
	QueueTypeNormal      QueueType = "normal"
	QueueTypeRepeatTrack QueueType = "repeat_track"
	QueueTypeRepeatQueue QueueType = "repeat_queue"
)

type QueueUpdate

type QueueUpdate struct {
	Type   *QueueType    `json:"type,omitempty"`
	Tracks *[]QueueTrack `json:"tracks,omitempty"`
}

Jump to

Keyboard shortcuts

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