Documentation ¶
Index ¶
- type SpotifyClient
- func (sc *SpotifyClient) CompleteAuth(w http.ResponseWriter, r *http.Request)
- func (sc *SpotifyClient) GetTopAlbums() (string, error)
- func (sc *SpotifyClient) GetTopTracks() (string, error)
- func (sc *SpotifyClient) InitSpotify(token *oauth2.Token)
- func (sc *SpotifyClient) Starting(dg *discordgo.Session, m *discordgo.MessageCreate, userID string) *spotify.Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SpotifyClient ¶
type SpotifyClient struct { Client *spotify.Client Connected bool AuthDone chan bool // Channel to signal when auth is done Config *oauth2.Config RedirectURI string State string }
SpotifyClient struct to store individual user session data
func NewSpotifyClient ¶
func NewSpotifyClient() *SpotifyClient
NewSpotifyClient creates a new SpotifyClient instance for a user
func (*SpotifyClient) CompleteAuth ¶
func (sc *SpotifyClient) CompleteAuth(w http.ResponseWriter, r *http.Request)
func (*SpotifyClient) GetTopAlbums ¶
func (sc *SpotifyClient) GetTopAlbums() (string, error)
GetTopAlbums returns the top albums for the authenticated user
func (*SpotifyClient) GetTopTracks ¶
func (sc *SpotifyClient) GetTopTracks() (string, error)
GetTopTracks returns the top tracks for the authenticated user
func (*SpotifyClient) InitSpotify ¶
func (sc *SpotifyClient) InitSpotify(token *oauth2.Token)
func (*SpotifyClient) Starting ¶
func (sc *SpotifyClient) Starting(dg *discordgo.Session, m *discordgo.MessageCreate, userID string) *spotify.Client
Starting initiates the Spotify login process for a specific user
Click to show internal directories.
Click to hide internal directories.