Merge pull request #425 from Androz2091/develop

v4.0.9
This commit is contained in:
MegaPixel 2021-05-13 22:10:51 +05:45 committed by GitHub
commit ee0406c57c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 11 deletions

View file

@ -1,6 +1,6 @@
{
"name": "discord-player",
"version": "4.0.8",
"version": "4.0.9",
"description": "Complete framework to facilitate music commands using discord.js",
"main": "lib/index.js",
"types": "lib/index.d.ts",

View file

@ -244,9 +244,7 @@ export class Player extends EventEmitter {
author: m.artists[0]?.name ?? 'Unknown Artist',
url: m.external_urls?.spotify ?? query,
thumbnail:
playlist.images[0]?.url ?? m.preview_url?.length
? `https://i.scdn.co/image/${m.preview_url?.split('?cid=')[1]}`
: 'https://www.scdn.co/i/_global/twitter_card-default.jpg',
playlist.images[0]?.url ?? 'https://www.scdn.co/i/_global/twitter_card-default.jpg',
duration: Util.buildTimeCode(Util.parseMS(m.duration_ms)),
views: 0,
requestedBy: message.author,
@ -282,10 +280,7 @@ export class Player extends EventEmitter {
description: m.track.description ?? '',
author: m.track.artists[0]?.name ?? 'Unknown Artist',
url: m.track.external_urls?.spotify ?? query,
thumbnail:
playlist.images[0]?.url ?? m.track.preview_url?.length
? `https://i.scdn.co/image/${m.track.preview_url?.split('?cid=')[1]}`
: 'https://www.scdn.co/i/_global/twitter_card-default.jpg',
thumbnail: m.track.album?.images[0]?.url ?? 'https://www.scdn.co/i/_global/twitter_card-default.jpg',
duration: Util.buildTimeCode(Util.parseMS(m.track.duration_ms)),
views: 0,
requestedBy: message.author,
@ -331,7 +326,7 @@ export class Player extends EventEmitter {
const queue = this._addTracksToQueue(message, tracks);
this.emit(PlayerEvents.PLAYLIST_ADD, message, queue, pl);
} else {
const track = tracks[0];
const track = tracks.shift();
const queue = (await this._createQueue(message, track).catch(
(e) => void this.emit(PlayerEvents.ERROR, e, message)
)) as Queue;
@ -387,7 +382,7 @@ export class Player extends EventEmitter {
const queue = this._addTracksToQueue(message, tracks);
this.emit(PlayerEvents.PLAYLIST_ADD, message, queue, playlist);
} else {
const track = tracks[0];
const track = tracks.shift();
const queue = (await this._createQueue(message, track).catch(
(e) => void this.emit(PlayerEvents.ERROR, e, message)
)) as Queue;
@ -442,7 +437,7 @@ export class Player extends EventEmitter {
const queue = this._addTracksToQueue(message, res.tracks);
this.emit(PlayerEvents.PLAYLIST_ADD, message, queue, res);
} else {
const track = res.tracks[0];
const track = res.tracks.shift();
const queue = (await this._createQueue(message, track).catch(
(e) => void this.emit(PlayerEvents.ERROR, e, message)
)) as Queue;