redo spotify track

This commit is contained in:
Snowflake107 2021-05-13 09:53:31 +05:45
parent 37f8dc67f8
commit aeb863e756

View file

@ -185,11 +185,11 @@ export class Player extends EventEmitter {
/https?:\/\/(?:embed\.|open\.)(?:spotify\.com\/)(?:track\/|\?uri=spotify:track:)((\w|-){22})/
);
if (matchSpotifyURL) {
const spotifyData = await spotify.getPreview(query).catch(() => {});
const spotifyData = await spotify.getData(query).catch(() => {});
if (spotifyData) {
const searchString = this.options.disableArtistSearch
? spotifyData.title
: `${spotifyData.artist} - ${spotifyData.title}`;
? spotifyData.name
: `${spotifyData.name}${spotifyData.artists[0] ? ` - ${spotifyData.artists[0]?.name}` : ""}`;
tracks = await Util.ytSearch(searchString, {
user: message.author,
player: this,