Documentation
¶
Index ¶
- Constants
- Variables
- func DisableForChat(chatID int64) error
- func DisableGlobally() error
- func DisableReviewsForChat(chatID int64) error
- func DisableReviewsGlobally() error
- func EnableForChat(chatID int64) error
- func EnableGlobally() error
- func EnableReviewsForChat(chatID int64) error
- func EnableReviewsGlobally() error
- func ExtractSpotifyID(input string) (string, error)
- func GetReviewModel(chatID *int64) string
- func RegenerateReview(chatID int64, spotifyID string) (string, error)
- func SetReviewModel(chatID *int64, model string) error
- type SpotifyAlbum
- type SpotifyPlugin
- func (p *SpotifyPlugin) EnsureAccessToken() error
- func (p *SpotifyPlugin) FetchAlbum(albumID string) (*SpotifyAlbum, error)
- func (p *SpotifyPlugin) FetchTrack(trackID string) (*SpotifyTrack, error)
- func (p *SpotifyPlugin) Process(message *telebot.Message)
- func (p *SpotifyPlugin) Start(_ interface{})
- type SpotifyTrack
Constants ¶
const ( SpotifyPluginName = "spotify" SpotifyEnabledKey = "enabled" SpotifyReviewEnabledKey = "review_enabled" SpotifyReviewModelKey = "review_model" )
Variables ¶
var ( SpotifyAuthURL = "https://accounts.spotify.com/api/token" SpotifyAPIBaseURL = "https://api.spotify.com/v1" )
Functions ¶
func DisableForChat ¶
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
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 ¶
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
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
ExtractSpotifyID returns a Spotify track/album ID from either a raw ID or URL.
func GetReviewModel ¶ added in v0.6.1
GetReviewModel returns the dedicated Spotify review model, or empty if not set.
func RegenerateReview ¶ added in v0.4.4
RegenerateReview regenerates a review for an existing Spotify item
func SetReviewModel ¶ added in v0.6.1
SetReviewModel sets a dedicated model for Spotify review generation.
Types ¶
type SpotifyAlbum ¶
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"`
}