A DisTube extractor plugin for supporting SoundCloud.
npm install @distube/soundcloudA DisTube extractor plugin for supporting SoundCloud.
- Using SoundCloud API
- Support SoundCloud tracks, albums and playlists
- Search tracks/playlists on SoundCloud
- Play tracks directly from SoundCloud
``sh`
npm install @distube/soundcloud@latest
`ts
import { Client } from "discord.js";
import { DisTube } from "distube";
import { SoundCloudPlugin } from "@distube/soundcloud";
const client = new Client();
const distube = new DisTube(client, {
plugins: [new SoundCloudPlugin()],
});
`
`ts`
const scPlugin = new SoundCloudPlugin();
scPlugin.search("A SoundCloud Playlist", "playlist", 3);
- SoundCloudPluginOptions.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.clientId
- How to get and oauthToken? See here
#### Example
`js`
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 (track or playlist). Default is track.limit
- [integer]: Limit the results. Default is 10.
- Returns a PromisePromise
- Returns a if type parameter is trackPromise
- Returns a if type parameter is playlist`