@distube/声音云
用于支持 SoundCloud 的 DisTube 提取器插件 .
特性
- 使用声云 API
- 支持 SoundCloud 音轨、相册和播放列表
- 在 SoundCloud 上搜索音轨/播放列表
- 从 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);
文档
新的声音Cloud Plugin( [声音CloudPlugin 选项])
SoundCloudPluginOptions.clientId[弦] (可选):你的账户的客户身份.SoundCloudPluginOptions.oauthToken[弦] (可选):你的账户是Oauth代币. 曾用 SoundCloud Go+ 账户获取更多数据.- 如何获得
clientId财务报告和审定财务报表oauthToken? 吗? 看这里
示例
new SoundCloudPlugin({
clientId: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
oauthToken: "0-000000-000000000-xxxxxxxxxxxxxx",
});
声音 CloudPlugin# search( 清, [类型], [限制])
搜索 SoundCloud 上的指定查询 .
-
参数
query[字符串]搜索查询.type[弦]:结果类型(track或者说playlist) (中文(简体) ). 默认是track。 。 。 .limit[整数]:限制结果. 默认是10。 。 。 .
-
回返a
Promise<Song[]|Playlist[]>- 回返a
Promise<Song[]>若为type参数是:track - 回返a
Promise<Playlist[]>若为type参数是:playlist
- 回返a
