Documentation
¶
Index ¶
- Constants
- Variables
- func ClearReviewModelOverride(chatID int64) error
- 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 SetReviewJudge(chatID *int64, model string) error
- func SetReviewModel(chatID *int64, model string) error
- func SetReviewModels(chatID *int64, models []string) error
- type ReviewSettings
- 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 ( SpotifyReviewModelsKey = "review_models" SpotifyReviewModeKey = "review_mode" SpotifyReviewJudgeModelKey = "review_judge_model" )
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 ClearReviewModelOverride ¶ added in v0.12.27
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 SetReviewJudge ¶ added in v0.12.27
func SetReviewModel ¶ added in v0.6.1
SetReviewModel sets a dedicated model for Spotify review generation.
func SetReviewModels ¶ added in v0.12.27
SetReviewModels atomically replaces mode, authors, and the legacy primary ID. Delete/insert also handles SQLite's non-unique NULL global scope correctly.
Types ¶
type ReviewSettings ¶ added in v0.12.27
ReviewSettings is the effective author configuration for a scope. JudgeModel inherits independently and is not invoked in single mode.
func GetReviewSettings ¶ added in v0.12.27
func GetReviewSettings(chatID *int64) ReviewSettings
Read all relevant rows in one snapshot; choose a complete model override from chat before global, never independently inherit mode/list across scopes.
type SpotifyAlbum ¶
type SpotifyAlbum struct {
Name string `json:"name"`
ReleaseDate string `json:"release_date"`
Tracks struct {
Items []struct {
Name string `json:"name"`
} `json:"items"`
Next string `json:"next"`
} `json:"tracks"`
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"`
}