commit
ee0406c57c
2 changed files with 6 additions and 11 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "discord-player",
|
"name": "discord-player",
|
||||||
"version": "4.0.8",
|
"version": "4.0.9",
|
||||||
"description": "Complete framework to facilitate music commands using discord.js",
|
"description": "Complete framework to facilitate music commands using discord.js",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"types": "lib/index.d.ts",
|
"types": "lib/index.d.ts",
|
||||||
|
|
|
@ -244,9 +244,7 @@ export class Player extends EventEmitter {
|
||||||
author: m.artists[0]?.name ?? 'Unknown Artist',
|
author: m.artists[0]?.name ?? 'Unknown Artist',
|
||||||
url: m.external_urls?.spotify ?? query,
|
url: m.external_urls?.spotify ?? query,
|
||||||
thumbnail:
|
thumbnail:
|
||||||
playlist.images[0]?.url ?? m.preview_url?.length
|
playlist.images[0]?.url ?? 'https://www.scdn.co/i/_global/twitter_card-default.jpg',
|
||||||
? `https://i.scdn.co/image/${m.preview_url?.split('?cid=')[1]}`
|
|
||||||
: 'https://www.scdn.co/i/_global/twitter_card-default.jpg',
|
|
||||||
duration: Util.buildTimeCode(Util.parseMS(m.duration_ms)),
|
duration: Util.buildTimeCode(Util.parseMS(m.duration_ms)),
|
||||||
views: 0,
|
views: 0,
|
||||||
requestedBy: message.author,
|
requestedBy: message.author,
|
||||||
|
@ -282,10 +280,7 @@ export class Player extends EventEmitter {
|
||||||
description: m.track.description ?? '',
|
description: m.track.description ?? '',
|
||||||
author: m.track.artists[0]?.name ?? 'Unknown Artist',
|
author: m.track.artists[0]?.name ?? 'Unknown Artist',
|
||||||
url: m.track.external_urls?.spotify ?? query,
|
url: m.track.external_urls?.spotify ?? query,
|
||||||
thumbnail:
|
thumbnail: m.track.album?.images[0]?.url ?? 'https://www.scdn.co/i/_global/twitter_card-default.jpg',
|
||||||
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',
|
|
||||||
duration: Util.buildTimeCode(Util.parseMS(m.track.duration_ms)),
|
duration: Util.buildTimeCode(Util.parseMS(m.track.duration_ms)),
|
||||||
views: 0,
|
views: 0,
|
||||||
requestedBy: message.author,
|
requestedBy: message.author,
|
||||||
|
@ -331,7 +326,7 @@ export class Player extends EventEmitter {
|
||||||
const queue = this._addTracksToQueue(message, tracks);
|
const queue = this._addTracksToQueue(message, tracks);
|
||||||
this.emit(PlayerEvents.PLAYLIST_ADD, message, queue, pl);
|
this.emit(PlayerEvents.PLAYLIST_ADD, message, queue, pl);
|
||||||
} else {
|
} else {
|
||||||
const track = tracks[0];
|
const track = tracks.shift();
|
||||||
const queue = (await this._createQueue(message, track).catch(
|
const queue = (await this._createQueue(message, track).catch(
|
||||||
(e) => void this.emit(PlayerEvents.ERROR, e, message)
|
(e) => void this.emit(PlayerEvents.ERROR, e, message)
|
||||||
)) as Queue;
|
)) as Queue;
|
||||||
|
@ -387,7 +382,7 @@ export class Player extends EventEmitter {
|
||||||
const queue = this._addTracksToQueue(message, tracks);
|
const queue = this._addTracksToQueue(message, tracks);
|
||||||
this.emit(PlayerEvents.PLAYLIST_ADD, message, queue, playlist);
|
this.emit(PlayerEvents.PLAYLIST_ADD, message, queue, playlist);
|
||||||
} else {
|
} else {
|
||||||
const track = tracks[0];
|
const track = tracks.shift();
|
||||||
const queue = (await this._createQueue(message, track).catch(
|
const queue = (await this._createQueue(message, track).catch(
|
||||||
(e) => void this.emit(PlayerEvents.ERROR, e, message)
|
(e) => void this.emit(PlayerEvents.ERROR, e, message)
|
||||||
)) as Queue;
|
)) as Queue;
|
||||||
|
@ -442,7 +437,7 @@ export class Player extends EventEmitter {
|
||||||
const queue = this._addTracksToQueue(message, res.tracks);
|
const queue = this._addTracksToQueue(message, res.tracks);
|
||||||
this.emit(PlayerEvents.PLAYLIST_ADD, message, queue, res);
|
this.emit(PlayerEvents.PLAYLIST_ADD, message, queue, res);
|
||||||
} else {
|
} else {
|
||||||
const track = res.tracks[0];
|
const track = res.tracks.shift();
|
||||||
const queue = (await this._createQueue(message, track).catch(
|
const queue = (await this._createQueue(message, track).catch(
|
||||||
(e) => void this.emit(PlayerEvents.ERROR, e, message)
|
(e) => void this.emit(PlayerEvents.ERROR, e, message)
|
||||||
)) as Queue;
|
)) as Queue;
|
||||||
|
|
Loading…
Reference in a new issue