discord-player 5.4.0 → 5.4.1-dev.0
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 +1 -1
- package/dist/index.d.ts +1492 -1281
- package/dist/index.js +2072 -36
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2039 -22
- package/dist/index.mjs.map +1 -0
- package/package.json +15 -31
- package/dist/Player.js +0 -623
- package/dist/Structures/ExtractorModel.js +0 -65
- package/dist/Structures/PlayerError.js +0 -48
- package/dist/Structures/Playlist.js +0 -108
- package/dist/Structures/Queue.js +0 -917
- package/dist/Structures/Track.js +0 -155
- package/dist/VoiceInterface/StreamDispatcher.js +0 -238
- package/dist/VoiceInterface/VoiceUtils.js +0 -65
- package/dist/VoiceInterface/VolumeTransformer.js +0 -120
- package/dist/smoothVolume.js +0 -15
- package/dist/types/types.js +0 -58
- package/dist/utils/AudioFilters.js +0 -95
- package/dist/utils/FFmpegStream.js +0 -53
- package/dist/utils/QueryResolver.js +0 -68
- package/dist/utils/Util.js +0 -136
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PlayerError = exports.ErrorStatusCode = void 0;
|
|
4
|
-
var ErrorStatusCode;
|
|
5
|
-
(function (ErrorStatusCode) {
|
|
6
|
-
ErrorStatusCode["STREAM_ERROR"] = "StreamError";
|
|
7
|
-
ErrorStatusCode["AUDIO_PLAYER_ERROR"] = "AudioPlayerError";
|
|
8
|
-
ErrorStatusCode["PLAYER_ERROR"] = "PlayerError";
|
|
9
|
-
ErrorStatusCode["NO_AUDIO_RESOURCE"] = "NoAudioResource";
|
|
10
|
-
ErrorStatusCode["UNKNOWN_GUILD"] = "UnknownGuild";
|
|
11
|
-
ErrorStatusCode["INVALID_ARG_TYPE"] = "InvalidArgType";
|
|
12
|
-
ErrorStatusCode["UNKNOWN_EXTRACTOR"] = "UnknownExtractor";
|
|
13
|
-
ErrorStatusCode["INVALID_EXTRACTOR"] = "InvalidExtractor";
|
|
14
|
-
ErrorStatusCode["INVALID_CHANNEL_TYPE"] = "InvalidChannelType";
|
|
15
|
-
ErrorStatusCode["INVALID_TRACK"] = "InvalidTrack";
|
|
16
|
-
ErrorStatusCode["UNKNOWN_REPEAT_MODE"] = "UnknownRepeatMode";
|
|
17
|
-
ErrorStatusCode["TRACK_NOT_FOUND"] = "TrackNotFound";
|
|
18
|
-
ErrorStatusCode["NO_CONNECTION"] = "NoConnection";
|
|
19
|
-
ErrorStatusCode["DESTROYED_QUEUE"] = "DestroyedQueue";
|
|
20
|
-
})(ErrorStatusCode = exports.ErrorStatusCode || (exports.ErrorStatusCode = {}));
|
|
21
|
-
class PlayerError extends Error {
|
|
22
|
-
constructor(message, code = ErrorStatusCode.PLAYER_ERROR) {
|
|
23
|
-
super();
|
|
24
|
-
this.createdAt = new Date();
|
|
25
|
-
this.message = `[${code}] ${message}`;
|
|
26
|
-
this.statusCode = code;
|
|
27
|
-
this.name = code;
|
|
28
|
-
Error.captureStackTrace(this);
|
|
29
|
-
}
|
|
30
|
-
get createdTimestamp() {
|
|
31
|
-
return this.createdAt.getTime();
|
|
32
|
-
}
|
|
33
|
-
valueOf() {
|
|
34
|
-
return this.statusCode;
|
|
35
|
-
}
|
|
36
|
-
toJSON() {
|
|
37
|
-
return {
|
|
38
|
-
stack: this.stack,
|
|
39
|
-
code: this.statusCode,
|
|
40
|
-
message: this.message,
|
|
41
|
-
created: this.createdTimestamp
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
toString() {
|
|
45
|
-
return this.stack;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.PlayerError = PlayerError;
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Playlist = void 0;
|
|
4
|
-
class Playlist {
|
|
5
|
-
/**
|
|
6
|
-
* Playlist constructor
|
|
7
|
-
* @param {Player} player The player
|
|
8
|
-
* @param {PlaylistInitData} data The data
|
|
9
|
-
*/
|
|
10
|
-
constructor(player, data) {
|
|
11
|
-
/**
|
|
12
|
-
* The player
|
|
13
|
-
* @name Playlist#player
|
|
14
|
-
* @type {Player}
|
|
15
|
-
* @readonly
|
|
16
|
-
*/
|
|
17
|
-
this.player = player;
|
|
18
|
-
/**
|
|
19
|
-
* The tracks in this playlist
|
|
20
|
-
* @name Playlist#tracks
|
|
21
|
-
* @type {Track[]}
|
|
22
|
-
*/
|
|
23
|
-
this.tracks = data.tracks ?? [];
|
|
24
|
-
/**
|
|
25
|
-
* The author of this playlist
|
|
26
|
-
* @name Playlist#author
|
|
27
|
-
* @type {object}
|
|
28
|
-
*/
|
|
29
|
-
this.author = data.author;
|
|
30
|
-
/**
|
|
31
|
-
* The description
|
|
32
|
-
* @name Playlist#description
|
|
33
|
-
* @type {string}
|
|
34
|
-
*/
|
|
35
|
-
this.description = data.description;
|
|
36
|
-
/**
|
|
37
|
-
* The thumbnail of this playlist
|
|
38
|
-
* @name Playlist#thumbnail
|
|
39
|
-
* @type {string}
|
|
40
|
-
*/
|
|
41
|
-
this.thumbnail = data.thumbnail;
|
|
42
|
-
/**
|
|
43
|
-
* The playlist type:
|
|
44
|
-
* - `album`
|
|
45
|
-
* - `playlist`
|
|
46
|
-
* @name Playlist#type
|
|
47
|
-
* @type {string}
|
|
48
|
-
*/
|
|
49
|
-
this.type = data.type;
|
|
50
|
-
/**
|
|
51
|
-
* The source of this playlist:
|
|
52
|
-
* - `youtube`
|
|
53
|
-
* - `soundcloud`
|
|
54
|
-
* - `spotify`
|
|
55
|
-
* - `arbitrary`
|
|
56
|
-
* @name Playlist#source
|
|
57
|
-
* @type {string}
|
|
58
|
-
*/
|
|
59
|
-
this.source = data.source;
|
|
60
|
-
/**
|
|
61
|
-
* The playlist id
|
|
62
|
-
* @name Playlist#id
|
|
63
|
-
* @type {string}
|
|
64
|
-
*/
|
|
65
|
-
this.id = data.id;
|
|
66
|
-
/**
|
|
67
|
-
* The playlist url
|
|
68
|
-
* @name Playlist#url
|
|
69
|
-
* @type {string}
|
|
70
|
-
*/
|
|
71
|
-
this.url = data.url;
|
|
72
|
-
/**
|
|
73
|
-
* The playlist title
|
|
74
|
-
* @type {string}
|
|
75
|
-
*/
|
|
76
|
-
this.title = data.title;
|
|
77
|
-
/**
|
|
78
|
-
* @name Playlist#rawPlaylist
|
|
79
|
-
* @type {any}
|
|
80
|
-
* @readonly
|
|
81
|
-
*/
|
|
82
|
-
}
|
|
83
|
-
*[Symbol.iterator]() {
|
|
84
|
-
yield* this.tracks;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* JSON representation of this playlist
|
|
88
|
-
* @param {boolean} [withTracks=true] If it should build json with tracks
|
|
89
|
-
* @returns {PlaylistJSON}
|
|
90
|
-
*/
|
|
91
|
-
toJSON(withTracks = true) {
|
|
92
|
-
const payload = {
|
|
93
|
-
id: this.id,
|
|
94
|
-
url: this.url,
|
|
95
|
-
title: this.title,
|
|
96
|
-
description: this.description,
|
|
97
|
-
thumbnail: this.thumbnail,
|
|
98
|
-
type: this.type,
|
|
99
|
-
source: this.source,
|
|
100
|
-
author: this.author,
|
|
101
|
-
tracks: []
|
|
102
|
-
};
|
|
103
|
-
if (withTracks)
|
|
104
|
-
payload.tracks = this.tracks.map((m) => m.toJSON(true));
|
|
105
|
-
return payload;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
exports.Playlist = Playlist;
|