spotify

package
v0.10.11 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SpotifyPluginName       = "spotify"
	SpotifyEnabledKey       = "enabled"
	SpotifyReviewEnabledKey = "review_enabled"
	SpotifyReviewModelKey   = "review_model"
)

Variables

View Source
var (
	SpotifyAuthURL    = "https://accounts.spotify.com/api/token"
	SpotifyAPIBaseURL = "https://api.spotify.com/v1"
)

Functions

func DisableForChat

func DisableForChat(chatID int64) error

DisableForChat disables the Spotify plugin for a specific chat

func DisableGlobally

func DisableGlobally() error

DisableGlobally disables the Spotify plugin globally

func DisableReviewsForChat added in v0.4.0

func DisableReviewsForChat(chatID int64) error

DisableReviewsForChat disables review generation for a specific chat

func DisableReviewsGlobally added in v0.4.0

func DisableReviewsGlobally() error

DisableReviewsGlobally disables review generation globally

func EnableForChat

func EnableForChat(chatID int64) error

EnableForChat enables the Spotify plugin for a specific chat

func EnableGlobally

func EnableGlobally() error

EnableGlobally enables the Spotify plugin globally

func EnableReviewsForChat added in v0.4.0

func EnableReviewsForChat(chatID int64) error

EnableReviewsForChat enables review generation for a specific chat

func EnableReviewsGlobally added in v0.4.0

func EnableReviewsGlobally() error

EnableReviewsGlobally enables review generation globally

func ExtractSpotifyID added in v0.6.2

func ExtractSpotifyID(input string) (string, error)

ExtractSpotifyID returns a Spotify track/album ID from either a raw ID or URL.

func GetReviewModel added in v0.6.1

func GetReviewModel(chatID *int64) string

GetReviewModel returns the dedicated Spotify review model, or empty if not set.

func RegenerateReview added in v0.4.4

func RegenerateReview(chatID int64, spotifyID string) (string, error)

RegenerateReview regenerates a review for an existing Spotify item

func SetReviewModel added in v0.6.1

func SetReviewModel(chatID *int64, model string) error

SetReviewModel sets a dedicated model for Spotify review generation.

Types

type SpotifyAlbum

type SpotifyAlbum struct {
	Name        string `json:"name"`
	ReleaseDate string `json:"release_date"`
	Images      []struct {
		URL    string `json:"url"`
		Height int    `json:"height"`
		Width  int    `json:"width"`
	} `json:"images"`
	Artists []struct {
		Name string `json:"name"`
	} `json:"artists"`
}

type SpotifyPlugin

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

func (*SpotifyPlugin) EnsureAccessToken added in v0.4.4

func (p *SpotifyPlugin) EnsureAccessToken() error

func (*SpotifyPlugin) FetchAlbum added in v0.4.4

func (p *SpotifyPlugin) FetchAlbum(albumID string) (*SpotifyAlbum, error)

func (*SpotifyPlugin) FetchTrack added in v0.4.4

func (p *SpotifyPlugin) FetchTrack(trackID string) (*SpotifyTrack, error)

func (*SpotifyPlugin) Process

func (p *SpotifyPlugin) Process(message *telebot.Message)

func (*SpotifyPlugin) Start

func (p *SpotifyPlugin) Start(_ interface{})

type SpotifyTrack added in v0.3.4

type SpotifyTrack struct {
	Name  string `json:"name"`
	Album struct {
		Name        string `json:"name"`
		ReleaseDate string `json:"release_date"`
		Images      []struct {
			URL    string `json:"url"`
			Height int    `json:"height"`
			Width  int    `json:"width"`
		} `json:"images"`
	} `json:"album"`
	Artists []struct {
		Name string `json:"name"`
	} `json:"artists"`
}

Jump to

Keyboard shortcuts

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