SoundCloud extractor plugin for DisTube.js.org.
- Using SoundCloud API
- Support SoundCloud tracks, albums and playlists
- Search on SoundCloud
- Play tracks directly from SoundCloud
npm install @distube/soundcloud@latestconst Discord = require("discord.js");
const client = new Discord.Client();
const { DisTube } = require("distube");
const { SoundCloudPlugin } = require("@distube/soundcloud");
const distube = new DisTube(client, {
plugins: [new SoundCloudPlugin()],
});const { SoundCloudPlugin } = require("@distube/soundcloud");
SoundCloudPlugin.search("A SoundCloud Track"); // static method
// Returns an array of 10 DisTube's Songs
const scPlugin = new SoundCloudPlugin();
scPlugin.search("A SoundCloud Playlist", "playlist", 3); // class method
// Returns an array of 3 DisTube's PlaylistSoundCloudPluginOptions.clientId[string] (optional): Your account's client id.SoundCloudPluginOptions.oauthToken[string] (optional): Your account's oauth token. Used to fetch more data with SoundCloud Go+ account.- How to get
clientIdandoauthToken? See here
new SoundCloudPlugin({
clientId: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
oauthToken: "0-000000-000000000-xxxxxxxxxxxxxx",
});Searches for the given query on SoundCloud.
-
Parameters
query[string] Search query.type[string]: Type of results (trackorplaylist). Default istrack.limit[integer]: Limit the results. Default is10.
-
Returns a
Promise<Song[]|Playlist[]>- Returns a
Promise<Song[]>iftypeparameter istrack - Returns a
Promise<Playlist[]>iftypeparameter isplaylist
- Returns a
