lavalyrics

package module
v0.0.0-...-b0a2318 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

README

lavalyrics-plugin

DisGoLink plugin for LavaLyrics.

Installation

$ go get github.com/disgoorg/lavalyrics-plugin

Usage

var client disgolink.Client
var sessionID string
var guildID snowflake.ID
lyrics, err := lavalyrics.GetLyrics(context.TODO(), client.BestNode().Rest(), sessionID, guildID)
if err != nil {
    // handle error
}

Troubleshooting

For help feel free to open an issue or reach out on Discord

Contributing

Contributions are welcomed but for bigger changes we recommend first reaching out via Discord or create an issue to discuss your problems, intentions and ideas.

License

Distributed under the License. See LICENSE for more information.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Line

type Line struct {
	Timestamp lavalink.Duration `json:"timestamp"`
	Duration  lavalink.Duration `json:"duration"`
	Line      string            `json:"line"`
	Plugin    lavalink.RawData  `json:"plugin"`
}

type Lyrics

type Lyrics struct {
	SourceName string           `json:"sourceName"`
	Text       string           `json:"text"`
	Lines      []Line           `json:"lines"`
	Plugin     lavalink.RawData `json:"plugin"`
}

func GetCurrentTrackLyrics

func GetCurrentTrackLyrics(ctx context.Context, client disgolink.RestClient, sessionID string, guildID snowflake.ID, skipTrackSource bool) (*Lyrics, error)

GetCurrentTrackLyrics returns the lyrics of the current track being played in the guild. If the current track has no lyrics, it will return nil.

func GetLyrics

func GetLyrics(ctx context.Context, client disgolink.RestClient, track lavalink.Track, skipTrackSource bool) (*Lyrics, error)

GetLyrics returns the lyrics of the provided track. If the track has no lyrics, it will return nil.

Jump to

Keyboard shortcuts

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