A 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
npm install @distube/soundcloud@latest
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()],
});
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. - How to get
clientId
andoauthToken
? 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 (track
orplaylist
). Default istrack
. -
limit
[integer]: Limit the results. Default is10
.
-
-
Returns a
Promise<Song[]|Playlist[]>
- Returns a
Promise<Song[]>
iftype
parameter istrack
- Returns a
Promise<Playlist[]>
iftype
parameter isplaylist
- Returns a