spotify-web-api-node icon indicating copy to clipboard operation
spotify-web-api-node copied to clipboard

problem with function documentation

Open kdrivas opened this issue 4 years ago • 0 comments

Hi!, I checked the documentation of the getMyCurrentPlaybackState function and found an example in the README:

spotifyApi.getMyCurrentPlaybackState()
  .then(function(data) {
    // Output items
    if (data.body && data.body.is_playing) {
      console.log("User is currently playing something!");
    } else {
      console.log("User is not playing anything, or doing so in private.");
    }
  }, function(err) {
    console.log('Something went wrong!', err);
  });

But as the result of the function, I got the following:

actions:
disallows: {resuming: true, skipping_prev: true}
[[Prototype]]: Object
context: {external_urls: {…}, href: 'https://api.spotify.com/v1/playlists/37i9dQZEVXcNsAGCiuC5KH', type: 'playlist', uri: 'spotify:playlist:37i9dQZEVXcNsAGCiuC5KH'}
currently_playing_type: "track"
device: {id: '22d586083b90d8014a3f2749e26881d522d4b0fd', is_active: true, is_private_session: false, is_restricted: false, name: 'Web Player (Chrome)', …}
is_playing: true
item: {album: {…}, artists: Array(1), available_markets: Array(178), disc_number: 1, duration_ms: 210396, …}
progress_ms: 63664
repeat_state: "off"
shuffle_state: false
timestamp: 1630865313581

the key "body" doesn't exist, Is it a documentation error?

kdrivas avatar Sep 05 '21 18:09 kdrivas