Skip to main content

spotify.js

spotify#

Module to handle communication with Spotify APIs

spotify.getSpotifyAccessToken(client, nocache)#

Gets a spotify access token, either from Redis or the Spotify API.

Kind: static method of spotify

ParamTypeDescription
clientobject

Client object from discord.js

nocacheboolean

If true, the cache will be skipped and go straight to the Spotify API

spotify.getYoutubeFromSpotify(client, url) โ‡’ Promise.<string>#

Searches for a Youtube video based on the Spotify URL input

Kind: static method of spotify
Returns: Promise.<string> -

Resolves to Youtube video URL

ParamTypeDescription
clientobject

Client object from discord.js

urlstring

Spotify URL

spotify.getYoutubeFromPlaylist(client, url) โ‡’ Promise.<Array.<string>>#

Converts tracks in a Spotify playlist to Youtube URLs

Kind: static method of spotify
Returns: Promise.<Array.<string>> -

The array of Youtube URLs

ParamTypeDescription
clientobject

Client object from discord.js

urlstring

Spotify playlist URL

spotify~isTrackURL(URL) โ‡’ boolean#

Kind: inner method of spotify
Returns: boolean -

If the URL is a Spotify Track URL or not

ParamTypeDescription
URLstring

The URL you want to test

spotify~isPlaylistURL(URL) โ‡’ boolean#

Kind: inner method of spotify
Returns: boolean -

If the URL is a Spotify Playlist URL or not

ParamTypeDescription
URLstring

The URL you want to test