3.1.0 • Published 2 years ago

@lavaclient/spotify v3.1.0

Weekly downloads
17
License
Apache-2.0
Repository
github
Last release
2 years ago

A lavaclient plugin that makes it easy to integrate spotify searching into any project.

  • Official Lavaclient Plugin
  • Supports tracks, playlists, and albums.
  • Handles RateLimiting soon
Stable
yarn add @lavaclient/spotify # or npm install
Beta
yarn add @lavaclient/spotify@beta # or npm install
import { Track, load } from "@lavaclient/spotify";
import { Node } from "lavaclient";

load({
    /* information used to authenticate */
    client: {
        id: "your spotify client id",
        secret: "your spotify client secret",
    },
    /* whether you want spotify tracks to resolve their youtube counterpart */
    autoResolveYoutubeTracks: false,
    /* the loaders to use. */
    loaders: [ "track", "album" ]
});

const node = new Node({ ... });

// example: in a command or something.
if (node.spotify.isSpotifyUrl(query)) {
    const item = await node.spotify.load(query)
    if (item instanceof Track) {
        const track = await item.resolveYoutubeTrack();
        await player.playTrack(track)
    }
}
Disclaimer

Leaving the autoResolveYoutubeVideos option on is much slower and could get you banned from YouTube, however IP Rotation will decrease your chances dramatically.


melike2d © 2018 - present

3.1.0

2 years ago

3.0.0-rc.1

3 years ago

3.0.0

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago