A DisTube extractor plugin for supporting Spotify.
npm install @distube/spotifyA DisTube info extractor plugin for supporting Spotify.
_What is an info extractor plugin?_
``js
const Discord = require("discord.js");
const client = new Discord.Client();
const { DisTube } = require("distube");
const { SpotifyPlugin } = require("@distube/spotify");
const distube = new DisTube(client, {
plugins: [new SpotifyPlugin()],
});
`
- SpotifyPluginOptions.api: (Optional) Spotify API credentials.SpotifyPluginOptions.api.clientId
- : Client ID of your Spotify application (Optional - Used when the plugin cannot get the credentials automatically)SpotifyPluginOptions.api.clientSecret
- : Client Secret of your Spotify application (Optional - Used when the plugin cannot get the credentials automatically)SpotifyPluginOptions.api.topTracksCountry
- : Country code of the top artist tracks (ISO 3166-1 alpha-2 country code). Default is US.
#### Example
`js``
new SpotifyPlugin({
api: {
clientId: "SpotifyAppClientID",
clientSecret: "SpotifyAppClientSecret",
topTracksCountry: "VN",
},
});