spotify

package
v0.0.0-...-f430a6b Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

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