discord-player 5.2.3-dev → 5.3.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +23 -19
- package/dist/Player.js +307 -285
- package/dist/Structures/ExtractorModel.js +19 -24
- package/dist/Structures/Playlist.js +1 -2
- package/dist/Structures/Queue.js +226 -237
- package/dist/Structures/Track.js +11 -14
- package/dist/VoiceInterface/StreamDispatcher.js +33 -41
- package/dist/VoiceInterface/VoiceUtils.js +14 -32
- package/dist/index.d.ts +24 -20
- package/dist/smoothVolume.js +1 -1
- package/dist/utils/AudioFilters.js +2 -2
- package/dist/utils/Util.js +36 -1
- package/package.json +24 -28
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ExtractorModel = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
class ExtractorModel {
|
|
6
5
|
/**
|
|
7
6
|
* Model for raw Discord Player extractors
|
|
@@ -28,27 +27,24 @@ class ExtractorModel {
|
|
|
28
27
|
* @param {string} query Query to handle
|
|
29
28
|
* @returns {Promise<ExtractorModelData>}
|
|
30
29
|
*/
|
|
31
|
-
handle(query) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}))) !== null && _c !== void 0 ? _c : []
|
|
50
|
-
};
|
|
51
|
-
});
|
|
30
|
+
async handle(query) {
|
|
31
|
+
const data = await this._raw.getInfo(query);
|
|
32
|
+
if (!data)
|
|
33
|
+
return null;
|
|
34
|
+
return {
|
|
35
|
+
playlist: data.playlist ?? null,
|
|
36
|
+
data: data.info?.map((m) => ({
|
|
37
|
+
title: m.title,
|
|
38
|
+
duration: m.duration,
|
|
39
|
+
thumbnail: m.thumbnail,
|
|
40
|
+
engine: m.engine,
|
|
41
|
+
views: m.views,
|
|
42
|
+
author: m.author,
|
|
43
|
+
description: m.description,
|
|
44
|
+
url: m.url,
|
|
45
|
+
source: m.source || "arbitrary"
|
|
46
|
+
})) ?? []
|
|
47
|
+
};
|
|
52
48
|
}
|
|
53
49
|
/**
|
|
54
50
|
* Method used by Discord Player to validate query with this extractor
|
|
@@ -63,8 +59,7 @@ class ExtractorModel {
|
|
|
63
59
|
* @type {string}
|
|
64
60
|
*/
|
|
65
61
|
get version() {
|
|
66
|
-
|
|
67
|
-
return (_a = this._raw.version) !== null && _a !== void 0 ? _a : "0.0.0";
|
|
62
|
+
return this._raw.version ?? "0.0.0";
|
|
68
63
|
}
|
|
69
64
|
}
|
|
70
65
|
exports.ExtractorModel = ExtractorModel;
|
|
@@ -8,7 +8,6 @@ class Playlist {
|
|
|
8
8
|
* @param {PlaylistInitData} data The data
|
|
9
9
|
*/
|
|
10
10
|
constructor(player, data) {
|
|
11
|
-
var _a;
|
|
12
11
|
/**
|
|
13
12
|
* The player
|
|
14
13
|
* @name Playlist#player
|
|
@@ -21,7 +20,7 @@ class Playlist {
|
|
|
21
20
|
* @name Playlist#tracks
|
|
22
21
|
* @type {Track[]}
|
|
23
22
|
*/
|
|
24
|
-
this.tracks =
|
|
23
|
+
this.tracks = data.tracks ?? [];
|
|
25
24
|
/**
|
|
26
25
|
* The author of this playlist
|
|
27
26
|
* @name Playlist#author
|