Advertisement
Guest User

Untitled

a guest
Feb 29th, 2020
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function getSong() {
  2.     request.get('https://api.spotify.com/v1/me/player/currently-playing', {
  3.         'auth': {
  4.             'bearer': ''
  5.         }
  6.     }, function (error, response, body) {
  7.         if (error) throw error;
  8.         let jsonBody = JSON.parse(body);
  9.         let name = jsonBody.item.album.artists[0].name;
  10.         let song = jsonBody.item.name;
  11.         client.say(target, name + " - " + song);
  12.     });
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement