spotify.js
#
spotifyModule to handle communication with Spotify APIs
- spotify
- static
- .getSpotifyAccessToken(client, nocache)
- .getYoutubeFromSpotify(client, url) โ
Promise.<string>
- .getYoutubeFromPlaylist(client, url) โ
Promise.<Array.<string>>
- inner
- ~isTrackURL(URL) โ
boolean
- ~isPlaylistURL(URL) โ
boolean
- ~isTrackURL(URL) โ
- static
#
spotify.getSpotifyAccessToken(client, nocache)Gets a spotify access token, either from Redis or the Spotify API.
Kind: static method of spotify
Param | Type | Description |
---|---|---|
client | object | Client object from discord.js |
nocache | boolean | If true, the cache will be skipped and go straight to the Spotify API |
Promise.<string>
#
spotify.getYoutubeFromSpotify(client, url) โ Searches for a Youtube video based on the Spotify URL input
Kind: static method of spotify
Returns: Promise.<string>
-
Resolves to Youtube video URL
Param | Type | Description |
---|---|---|
client | object | Client object from discord.js |
url | string | Spotify URL |
Promise.<Array.<string>>
#
spotify.getYoutubeFromPlaylist(client, url) โ Converts tracks in a Spotify playlist to Youtube URLs
Kind: static method of spotify
Returns: Promise.<Array.<string>>
-
The array of Youtube URLs
Param | Type | Description |
---|---|---|
client | object | Client object from discord.js |
url | string | Spotify playlist URL |
boolean
#
spotify~isTrackURL(URL) โ Kind: inner method of spotify
Returns: boolean
-
If the URL is a Spotify Track URL or not
Param | Type | Description |
---|---|---|
URL | string | The URL you want to test |
boolean
#
spotify~isPlaylistURL(URL) โ Kind: inner method of spotify
Returns: boolean
-
If the URL is a Spotify Playlist URL or not
Param | Type | Description |
---|---|---|
URL | string | The URL you want to test |