Closed dozheiny closed 2 years ago
Do you have a short code snipper that reproduces the issue ?
yeah
// create spotify client connection and context to connect spotify
client, ctx := api.SpotifyConnection(SPOTIFYTOKEN, SPOTIFYSECRET)
// add playlist
playlist, err := client.GetPlaylist(ctx, PLAYLISTID)
if err != nil {
log.Fatal(err.Error())
}
/* SOME CODES */
if results.Tracks != nil {
items := results.Tracks.Tracks
musicID := items[0].ID.String()
cmd.AddMusic(client, ctx, playlist.ID.String(), musicID)
Ah I see, are you authenticating as a user or just as an application ? To be able to add stuff to playlists I believe you need to authenticate as a user via oauth
oh yes, you right thanks , really
Hello. I had a problem. I'm writing a bot that takes the name of the music and the artist and adds it to the selected playlist. Everything works except add music section to the playlist; the bot gives me this error:
this request requires user authentication.
but Spotify token and Spotify secret are valid.I searched, but I didn't get anything. Is there anything more needed than Spotify Token and Spotify Secret? what should I do?