magmastream 2.9.3-dev.3 → 2.9.3-dev.31
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/dist/config/blockedWords.d.ts +1 -0
- package/dist/index.d.ts +19 -3687
- package/dist/index.js +1 -1
- package/dist/statestorage/JsonQueue.d.ts +173 -0
- package/dist/statestorage/JsonQueue.js +32 -4
- package/dist/statestorage/MemoryQueue.d.ts +154 -0
- package/dist/statestorage/MemoryQueue.js +56 -36
- package/dist/statestorage/RedisQueue.d.ts +178 -0
- package/dist/statestorage/RedisQueue.js +29 -7
- package/dist/structures/Enums.d.ts +310 -0
- package/dist/structures/Enums.js +6 -0
- package/dist/structures/Filters.d.ts +352 -0
- package/dist/structures/Filters.js +5 -4
- package/dist/structures/MagmastreamError.d.ts +14 -0
- package/dist/structures/Manager.d.ts +259 -0
- package/dist/structures/Manager.js +296 -555
- package/dist/structures/Node.d.ts +390 -0
- package/dist/structures/Node.js +100 -145
- package/dist/structures/Player.d.ts +347 -0
- package/dist/structures/Player.js +55 -132
- package/dist/structures/Plugin.d.ts +23 -0
- package/dist/structures/Rest.d.ts +93 -0
- package/dist/structures/Rest.js +41 -21
- package/dist/structures/Types.d.ts +1315 -0
- package/dist/structures/Utils.d.ts +169 -0
- package/dist/structures/Utils.js +145 -71
- package/dist/utils/filtersEqualizers.d.ts +16 -0
- package/dist/utils/managerCheck.d.ts +7 -0
- package/dist/utils/nodeCheck.d.ts +7 -0
- package/dist/utils/playerCheck.d.ts +7 -0
- package/dist/wrappers/discord.js.d.ts +15 -0
- package/dist/wrappers/discord.js.js +19 -4
- package/dist/wrappers/discordeno.d.ts +19 -0
- package/dist/wrappers/discordeno.js +77 -0
- package/dist/wrappers/eris.d.ts +15 -0
- package/dist/wrappers/eris.js +20 -3
- package/dist/wrappers/oceanic.d.ts +15 -0
- package/dist/wrappers/oceanic.js +22 -4
- package/dist/wrappers/seyfert.d.ts +37 -0
- package/dist/wrappers/seyfert.js +25 -1
- package/package.json +106 -98
- package/dist/wrappers/detritus.js +0 -52
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { Manager } from "../structures/Manager";
|
|
2
|
+
import { IQueue, Track } from "../structures/Types";
|
|
3
|
+
/**
|
|
4
|
+
* The player's queue, the `current` property is the currently playing track, think of the rest as the up-coming tracks.
|
|
5
|
+
*/
|
|
6
|
+
export declare class RedisQueue implements IQueue {
|
|
7
|
+
readonly guildId: string;
|
|
8
|
+
readonly manager: Manager;
|
|
9
|
+
/**
|
|
10
|
+
* The prefix for the Redis keys.
|
|
11
|
+
*/
|
|
12
|
+
redisPrefix: string;
|
|
13
|
+
/**
|
|
14
|
+
* The Redis instance.
|
|
15
|
+
*/
|
|
16
|
+
private redis;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the queue has been destroyed.
|
|
19
|
+
*/
|
|
20
|
+
private destroyed;
|
|
21
|
+
/**
|
|
22
|
+
* Constructs a new RedisQueue.
|
|
23
|
+
* @param guildId The guild ID.
|
|
24
|
+
* @param manager The Manager instance.
|
|
25
|
+
*/
|
|
26
|
+
constructor(guildId: string, manager: Manager);
|
|
27
|
+
/**
|
|
28
|
+
* Adds a track or tracks to the queue.
|
|
29
|
+
* @param track The track or tracks to add. Can be a single `Track` or an array of `Track`s.
|
|
30
|
+
* @param [offset=null] The position to add the track(s) at. If not provided, the track(s) will be added at the end of the queue.
|
|
31
|
+
*/
|
|
32
|
+
add(track: Track | Track[], offset?: number): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Adds a track or tracks to the previous tracks.
|
|
35
|
+
* @param track The track or tracks to add.
|
|
36
|
+
*/
|
|
37
|
+
addPrevious(track: Track | Track[]): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Clears the queue.
|
|
40
|
+
*/
|
|
41
|
+
clear(): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Clears the previous tracks.
|
|
44
|
+
*/
|
|
45
|
+
clearPrevious(): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Removes the first track from the queue.
|
|
48
|
+
*/
|
|
49
|
+
dequeue(): Promise<Track | undefined>;
|
|
50
|
+
/**
|
|
51
|
+
* Destroys the queue and releases all resources.
|
|
52
|
+
* After calling this method, the queue must not be used again.
|
|
53
|
+
*/
|
|
54
|
+
destroy(): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* @returns The total duration of the queue in milliseconds.
|
|
57
|
+
* This includes the duration of the currently playing track.
|
|
58
|
+
*/
|
|
59
|
+
duration(): Promise<number>;
|
|
60
|
+
/**
|
|
61
|
+
* Adds a track to the front of the queue.
|
|
62
|
+
* @param track The track or tracks to add.
|
|
63
|
+
*/
|
|
64
|
+
enqueueFront(track: Track | Track[]): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Whether all tracks in the queue match the specified condition.
|
|
67
|
+
* @param callback The condition to match.
|
|
68
|
+
* @returns Whether all tracks in the queue match the specified condition.
|
|
69
|
+
*/
|
|
70
|
+
everyAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Promise<boolean>;
|
|
71
|
+
/**
|
|
72
|
+
* Filters the tracks in the queue.
|
|
73
|
+
* @param callback The condition to match.
|
|
74
|
+
* @returns The tracks that match the condition.
|
|
75
|
+
*/
|
|
76
|
+
filterAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Promise<Track[]>;
|
|
77
|
+
/**
|
|
78
|
+
* Finds the first track in the queue that matches the specified condition.
|
|
79
|
+
* @param callback The condition to match.
|
|
80
|
+
* @returns The first track that matches the condition.
|
|
81
|
+
*/
|
|
82
|
+
findAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Promise<Track | undefined>;
|
|
83
|
+
/**
|
|
84
|
+
* @returns The current track.
|
|
85
|
+
*/
|
|
86
|
+
getCurrent(): Promise<Track | null>;
|
|
87
|
+
/**
|
|
88
|
+
* @returns The previous tracks.
|
|
89
|
+
*/
|
|
90
|
+
getPrevious(): Promise<Track[]>;
|
|
91
|
+
/**
|
|
92
|
+
* @returns The tracks in the queue from the start to the end.
|
|
93
|
+
*/
|
|
94
|
+
getSlice(start?: number, end?: number): Promise<Track[]>;
|
|
95
|
+
/**
|
|
96
|
+
* @returns The tracks in the queue.
|
|
97
|
+
*/
|
|
98
|
+
getTracks(): Promise<Track[]>;
|
|
99
|
+
/**
|
|
100
|
+
* Maps the tracks in the queue.
|
|
101
|
+
* @returns The tracks in the queue after the specified index.
|
|
102
|
+
*/
|
|
103
|
+
mapAsync<T>(callback: (track: Track, index: number, array: Track[]) => T): Promise<T[]>;
|
|
104
|
+
/**
|
|
105
|
+
* Modifies the queue at the specified index.
|
|
106
|
+
* @param start The start index.
|
|
107
|
+
* @param deleteCount The number of tracks to delete.
|
|
108
|
+
* @param items The tracks to insert.
|
|
109
|
+
* @returns The removed tracks.
|
|
110
|
+
*/
|
|
111
|
+
modifyAt(start: number, deleteCount?: number, ...items: Track[]): Promise<Track[]>;
|
|
112
|
+
/**
|
|
113
|
+
* Removes the newest track.
|
|
114
|
+
* @returns The newest track.
|
|
115
|
+
*/
|
|
116
|
+
popPrevious(): Promise<Track | null>;
|
|
117
|
+
/**
|
|
118
|
+
* Removes the track at the specified index.
|
|
119
|
+
* @param position The position to remove the track at.
|
|
120
|
+
* @param end The end position to remove the track at.
|
|
121
|
+
*/
|
|
122
|
+
remove(position?: number): Promise<Track[]>;
|
|
123
|
+
remove(start: number, end: number): Promise<Track[]>;
|
|
124
|
+
/**
|
|
125
|
+
* Shuffles the queue round-robin style.
|
|
126
|
+
*/
|
|
127
|
+
roundRobinShuffle(): Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* Sets the current track.
|
|
130
|
+
* @param track The track to set.
|
|
131
|
+
*/
|
|
132
|
+
setCurrent(track: Track | null): Promise<void>;
|
|
133
|
+
/**
|
|
134
|
+
* Sets the previous track(s).
|
|
135
|
+
* @param track The track to set.
|
|
136
|
+
*/
|
|
137
|
+
setPrevious(track: Track | Track[]): Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* Shuffles the queue.
|
|
140
|
+
*/
|
|
141
|
+
shuffle(): Promise<void>;
|
|
142
|
+
/**
|
|
143
|
+
* @returns The size of the queue.
|
|
144
|
+
*/
|
|
145
|
+
size(): Promise<number>;
|
|
146
|
+
/**
|
|
147
|
+
* @returns Whether any tracks in the queue match the specified condition.
|
|
148
|
+
*/
|
|
149
|
+
someAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Promise<boolean>;
|
|
150
|
+
/**
|
|
151
|
+
* @returns The total size of tracks in the queue including the current track.
|
|
152
|
+
*/
|
|
153
|
+
totalSize(): Promise<number>;
|
|
154
|
+
/**
|
|
155
|
+
* Shuffles the queue, but keeps the tracks of the same user together.
|
|
156
|
+
*/
|
|
157
|
+
userBlockShuffle(): Promise<void>;
|
|
158
|
+
/**
|
|
159
|
+
* @returns The current key.
|
|
160
|
+
*/
|
|
161
|
+
private get currentKey();
|
|
162
|
+
/**
|
|
163
|
+
* Deserializes a track from a string.
|
|
164
|
+
*/
|
|
165
|
+
private deserialize;
|
|
166
|
+
/**
|
|
167
|
+
* @returns The previous key.
|
|
168
|
+
*/
|
|
169
|
+
private get previousKey();
|
|
170
|
+
/**
|
|
171
|
+
* @returns The queue key.
|
|
172
|
+
*/
|
|
173
|
+
private get queueKey();
|
|
174
|
+
/**
|
|
175
|
+
* Helper to serialize/deserialize Track
|
|
176
|
+
*/
|
|
177
|
+
private serialize;
|
|
178
|
+
}
|
|
@@ -18,6 +18,10 @@ class RedisQueue {
|
|
|
18
18
|
* The Redis instance.
|
|
19
19
|
*/
|
|
20
20
|
redis;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the queue has been destroyed.
|
|
23
|
+
*/
|
|
24
|
+
destroyed = false;
|
|
21
25
|
/**
|
|
22
26
|
* Constructs a new RedisQueue.
|
|
23
27
|
* @param guildId The guild ID.
|
|
@@ -27,11 +31,7 @@ class RedisQueue {
|
|
|
27
31
|
this.guildId = guildId;
|
|
28
32
|
this.manager = manager;
|
|
29
33
|
this.redis = manager.redis;
|
|
30
|
-
|
|
31
|
-
let clean = typeof rawPrefix === "string" ? rawPrefix.trim() : "";
|
|
32
|
-
if (!clean.endsWith(":"))
|
|
33
|
-
clean = clean || "magmastream";
|
|
34
|
-
this.redisPrefix = `${clean}:`;
|
|
34
|
+
this.redisPrefix = Utils_1.PlayerUtils.getRedisKey();
|
|
35
35
|
}
|
|
36
36
|
// #region Public
|
|
37
37
|
/**
|
|
@@ -222,6 +222,28 @@ class RedisQueue {
|
|
|
222
222
|
console.error(error);
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* Destroys the queue and releases all resources.
|
|
227
|
+
* After calling this method, the queue must not be used again.
|
|
228
|
+
*/
|
|
229
|
+
async destroy() {
|
|
230
|
+
if (this.destroyed)
|
|
231
|
+
return;
|
|
232
|
+
this.destroyed = true;
|
|
233
|
+
try {
|
|
234
|
+
await this.redis.del(this.queueKey, this.previousKey, this.currentKey);
|
|
235
|
+
}
|
|
236
|
+
catch (err) {
|
|
237
|
+
const error = err instanceof MagmastreamError_1.MagmaStreamError
|
|
238
|
+
? err
|
|
239
|
+
: new MagmastreamError_1.MagmaStreamError({
|
|
240
|
+
code: Enums_1.MagmaStreamErrorCode.QUEUE_REDIS_ERROR,
|
|
241
|
+
message: `Failed to destroy RedisQueue for guild ${this.guildId}: ${err.message}`,
|
|
242
|
+
cause: err,
|
|
243
|
+
});
|
|
244
|
+
console.error(error);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
225
247
|
/**
|
|
226
248
|
* @returns The total duration of the queue in milliseconds.
|
|
227
249
|
* This includes the duration of the currently playing track.
|
|
@@ -487,7 +509,7 @@ class RedisQueue {
|
|
|
487
509
|
const deserialized = rawTracks.map(this.deserialize);
|
|
488
510
|
const userMap = new Map();
|
|
489
511
|
for (const track of deserialized) {
|
|
490
|
-
const userId = track.requester.id;
|
|
512
|
+
const userId = track.requester.id.toString();
|
|
491
513
|
if (!userMap.has(userId))
|
|
492
514
|
userMap.set(userId, []);
|
|
493
515
|
userMap.get(userId).push(track);
|
|
@@ -658,7 +680,7 @@ class RedisQueue {
|
|
|
658
680
|
const deserialized = rawTracks.map(this.deserialize);
|
|
659
681
|
const userMap = new Map();
|
|
660
682
|
for (const track of deserialized) {
|
|
661
|
-
const userId = track.requester.id;
|
|
683
|
+
const userId = track.requester.id.toString();
|
|
662
684
|
if (!userMap.has(userId))
|
|
663
685
|
userMap.set(userId, []);
|
|
664
686
|
userMap.get(userId).push(track);
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* State Storage Enum
|
|
3
|
+
*/
|
|
4
|
+
export declare enum StateStorageType {
|
|
5
|
+
Memory = "memory",
|
|
6
|
+
Redis = "redis",
|
|
7
|
+
JSON = "json"
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* AutoPlay Platform Enum
|
|
11
|
+
*/
|
|
12
|
+
export declare enum AutoPlayPlatform {
|
|
13
|
+
Spotify = "spotify",
|
|
14
|
+
Deezer = "deezer",
|
|
15
|
+
SoundCloud = "soundcloud",
|
|
16
|
+
Tidal = "tidal",
|
|
17
|
+
VKMusic = "vkmusic",
|
|
18
|
+
Qobuz = "qobuz",
|
|
19
|
+
YouTube = "youtube"
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* State Types Enum
|
|
23
|
+
*/
|
|
24
|
+
export declare enum StateTypes {
|
|
25
|
+
Connected = "CONNECTED",
|
|
26
|
+
Connecting = "CONNECTING",
|
|
27
|
+
Disconnected = "DISCONNECTED",
|
|
28
|
+
Disconnecting = "DISCONNECTING",
|
|
29
|
+
Destroying = "DESTROYING"
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Load Types Enum
|
|
33
|
+
*/
|
|
34
|
+
export declare enum LoadTypes {
|
|
35
|
+
Track = "track",
|
|
36
|
+
Playlist = "playlist",
|
|
37
|
+
Search = "search",
|
|
38
|
+
Empty = "empty",
|
|
39
|
+
Error = "error",
|
|
40
|
+
/** Nodelink */
|
|
41
|
+
Album = "album",
|
|
42
|
+
/** Nodelink */
|
|
43
|
+
Artist = "artist",
|
|
44
|
+
/** Nodelink */
|
|
45
|
+
Station = "station",
|
|
46
|
+
/** Nodelink */
|
|
47
|
+
Podcast = "podcast",
|
|
48
|
+
/** Nodelink */
|
|
49
|
+
Show = "show",
|
|
50
|
+
/** Nodelink */
|
|
51
|
+
Short = "short"
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Search Platform Enum
|
|
55
|
+
*/
|
|
56
|
+
export declare enum SearchPlatform {
|
|
57
|
+
AppleMusic = "amsearch",
|
|
58
|
+
Audius = "audsearch",
|
|
59
|
+
Bandcamp = "bcsearch",
|
|
60
|
+
Deezer = "dzsearch",
|
|
61
|
+
Jiosaavn = "jssearch",
|
|
62
|
+
Qobuz = "qbsearch",
|
|
63
|
+
SoundCloud = "scsearch",
|
|
64
|
+
Spotify = "spsearch",
|
|
65
|
+
Tidal = "tdsearch",
|
|
66
|
+
TTS = "speak",
|
|
67
|
+
VKMusic = "vksearch",
|
|
68
|
+
YouTube = "ytsearch",
|
|
69
|
+
YouTubeMusic = "ytmsearch"
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Player State Event Types Enum
|
|
73
|
+
*/
|
|
74
|
+
export declare enum PlayerStateEventTypes {
|
|
75
|
+
AutoPlayChange = "playerAutoplay",
|
|
76
|
+
ConnectionChange = "playerConnection",
|
|
77
|
+
RepeatChange = "playerRepeat",
|
|
78
|
+
PauseChange = "playerPause",
|
|
79
|
+
QueueChange = "queueChange",
|
|
80
|
+
TrackChange = "trackChange",
|
|
81
|
+
VolumeChange = "volumeChange",
|
|
82
|
+
ChannelChange = "channelChange",
|
|
83
|
+
PlayerCreate = "playerCreate",
|
|
84
|
+
PlayerDestroy = "playerDestroy",
|
|
85
|
+
FilterChange = "filterChange"
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Track Source Types Enum
|
|
89
|
+
*/
|
|
90
|
+
export declare enum TrackSourceTypes {
|
|
91
|
+
AppleMusic = "AppleMusic",
|
|
92
|
+
Audius = "Audius",
|
|
93
|
+
Bandcamp = "Bandcamp",
|
|
94
|
+
Deezer = "Deezer",
|
|
95
|
+
Jiosaavn = "Jiosaavn",
|
|
96
|
+
Qobuz = "Qobuz",
|
|
97
|
+
SoundCloud = "SoundCloud",
|
|
98
|
+
Spotify = "Spotify",
|
|
99
|
+
Tidal = "Tidal",
|
|
100
|
+
VKMusic = "VKMusic",
|
|
101
|
+
YouTube = "YouTube",
|
|
102
|
+
Pornhub = "Pornub",
|
|
103
|
+
TikTok = "TikTok",
|
|
104
|
+
Flowertts = "Flowertts",
|
|
105
|
+
Ocremix = "Ocremix",
|
|
106
|
+
Mixcloud = "Mixcloud",
|
|
107
|
+
Soundgasm = "Soundgasm",
|
|
108
|
+
Reddit = "Reddit",
|
|
109
|
+
Clypit = "Clypit",
|
|
110
|
+
Http = "Http",
|
|
111
|
+
Tts = "Tts"
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Use Node Options Enum
|
|
115
|
+
*/
|
|
116
|
+
export declare enum UseNodeOptions {
|
|
117
|
+
LeastLoad = "leastLoad",
|
|
118
|
+
LeastPlayers = "leastPlayers"
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Track Partial Enum
|
|
122
|
+
*/
|
|
123
|
+
export declare enum TrackPartial {
|
|
124
|
+
/** The base64 encoded string of the track */
|
|
125
|
+
Track = "track",
|
|
126
|
+
/** The title of the track */
|
|
127
|
+
Title = "title",
|
|
128
|
+
/** The track identifier */
|
|
129
|
+
Identifier = "identifier",
|
|
130
|
+
/** The author of the track */
|
|
131
|
+
Author = "author",
|
|
132
|
+
/** The length of the track in milliseconds */
|
|
133
|
+
Duration = "duration",
|
|
134
|
+
/** The ISRC of the track */
|
|
135
|
+
Isrc = "isrc",
|
|
136
|
+
/** Whether the track is seekable */
|
|
137
|
+
IsSeekable = "isSeekable",
|
|
138
|
+
/** Whether the track is a stream */
|
|
139
|
+
IsStream = "isStream",
|
|
140
|
+
/** The URI of the track */
|
|
141
|
+
Uri = "uri",
|
|
142
|
+
/** The artwork URL of the track */
|
|
143
|
+
ArtworkUrl = "artworkUrl",
|
|
144
|
+
/** The source name of the track */
|
|
145
|
+
SourceName = "sourceName",
|
|
146
|
+
/** The thumbnail of the track */
|
|
147
|
+
ThumbNail = "thumbnail",
|
|
148
|
+
/** The requester of the track */
|
|
149
|
+
Requester = "requester",
|
|
150
|
+
/** The plugin info of the track */
|
|
151
|
+
PluginInfo = "pluginInfo",
|
|
152
|
+
/** The custom data of the track */
|
|
153
|
+
CustomData = "customData",
|
|
154
|
+
/** Whether the track got autoplayed */
|
|
155
|
+
IsAutoPlay = "isAutoplay"
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Manager Event Types Enum
|
|
159
|
+
*/
|
|
160
|
+
export declare enum ManagerEventTypes {
|
|
161
|
+
ChapterStarted = "chapterStarted",
|
|
162
|
+
ChaptersLoaded = "chaptersLoaded",
|
|
163
|
+
Debug = "debug",
|
|
164
|
+
LyricsFound = "lyricsFound",
|
|
165
|
+
LyricsLine = "lyricsLine",
|
|
166
|
+
LyricsNotFound = "lyricsNotFound",
|
|
167
|
+
NodeConnect = "nodeConnect",
|
|
168
|
+
NodeCreate = "nodeCreate",
|
|
169
|
+
NodeDestroy = "nodeDestroy",
|
|
170
|
+
NodeDisconnect = "nodeDisconnect",
|
|
171
|
+
NodeError = "nodeError",
|
|
172
|
+
NodeRaw = "nodeRaw",
|
|
173
|
+
NodeReconnect = "nodeReconnect",
|
|
174
|
+
PlayerCreate = "playerCreate",
|
|
175
|
+
PlayerDestroy = "playerDestroy",
|
|
176
|
+
PlayerDisconnect = "playerDisconnect",
|
|
177
|
+
PlayerMove = "playerMove",
|
|
178
|
+
PlayerRestored = "playerRestored",
|
|
179
|
+
PlayerStateUpdate = "playerStateUpdate",
|
|
180
|
+
QueueEnd = "queueEnd",
|
|
181
|
+
RestoreComplete = "restoreComplete",
|
|
182
|
+
SegmentSkipped = "segmentSkipped",
|
|
183
|
+
SegmentsLoaded = "segmentsLoaded",
|
|
184
|
+
SocketClosed = "socketClosed",
|
|
185
|
+
TrackEnd = "trackEnd",
|
|
186
|
+
TrackError = "trackError",
|
|
187
|
+
TrackStart = "trackStart",
|
|
188
|
+
TrackStuck = "trackStuck",
|
|
189
|
+
/** Nodelink */
|
|
190
|
+
VoiceReceiverDisconnect = "voiceReceiverDisconnect",
|
|
191
|
+
/** Nodelink */
|
|
192
|
+
VoiceReceiverConnect = "voiceReceiverConnect",
|
|
193
|
+
/** Nodelink */
|
|
194
|
+
VoiceReceiverError = "voiceReceiverError",
|
|
195
|
+
/** Nodelink */
|
|
196
|
+
VoiceReceiverStartSpeaking = "voiceReceiverStartSpeaking",
|
|
197
|
+
/** Nodelink */
|
|
198
|
+
VoiceReceiverEndSpeaking = "voiceReceiverEndSpeaking"
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Track End Reason Enum
|
|
202
|
+
*/
|
|
203
|
+
export declare enum TrackEndReasonTypes {
|
|
204
|
+
Finished = "finished",
|
|
205
|
+
LoadFailed = "loadFailed",
|
|
206
|
+
Stopped = "stopped",
|
|
207
|
+
Replaced = "replaced",
|
|
208
|
+
Cleanup = "cleanup"
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Severity Types Enum
|
|
212
|
+
*/
|
|
213
|
+
export declare enum SeverityTypes {
|
|
214
|
+
Common = "common",
|
|
215
|
+
Suspicious = "suspicious",
|
|
216
|
+
Fault = "fault"
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* SponsorBlock Segment Enum
|
|
220
|
+
*/
|
|
221
|
+
export declare enum SponsorBlockSegment {
|
|
222
|
+
Filler = "filler",
|
|
223
|
+
Interaction = "interaction",
|
|
224
|
+
Intro = "intro",
|
|
225
|
+
MusicOfftopic = "music_offtopic",
|
|
226
|
+
Outro = "outro",
|
|
227
|
+
Preview = "preview",
|
|
228
|
+
SelfPromo = "selfpromo",
|
|
229
|
+
Sponsor = "sponsor"
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Available Filters Enum
|
|
233
|
+
*/
|
|
234
|
+
export declare enum AvailableFilters {
|
|
235
|
+
BassBoost = "bassboost",
|
|
236
|
+
China = "china",
|
|
237
|
+
Chipmunk = "chipmunk",
|
|
238
|
+
Darthvader = "darthvader",
|
|
239
|
+
Daycore = "daycore",
|
|
240
|
+
Demon = "demon",
|
|
241
|
+
Distort = "distort",
|
|
242
|
+
Doubletime = "doubletime",
|
|
243
|
+
Earrape = "earrape",
|
|
244
|
+
EightD = "eightD",
|
|
245
|
+
Electronic = "electronic",
|
|
246
|
+
Nightcore = "nightcore",
|
|
247
|
+
Party = "party",
|
|
248
|
+
Pop = "pop",
|
|
249
|
+
Radio = "radio",
|
|
250
|
+
SetDistortion = "setDistortion",
|
|
251
|
+
SetKaraoke = "setKaraoke",
|
|
252
|
+
SetRotation = "setRotation",
|
|
253
|
+
SetTimescale = "setTimescale",
|
|
254
|
+
Slowmo = "slowmo",
|
|
255
|
+
Soft = "soft",
|
|
256
|
+
TrebleBass = "trebleBass",
|
|
257
|
+
Tremolo = "tremolo",
|
|
258
|
+
TV = "tv",
|
|
259
|
+
Vaporwave = "vaporwave",
|
|
260
|
+
Vibrato = "vibrato"
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* MagmaStream Error Codes Enum
|
|
264
|
+
*/
|
|
265
|
+
export declare enum MagmaStreamErrorCode {
|
|
266
|
+
GENERAL_UNKNOWN = "MS_GENERAL_UNKNOWN",
|
|
267
|
+
GENERAL_TIMEOUT = "MS_GENERAL_TIMEOUT",
|
|
268
|
+
GENERAL_INVALID_MANAGER = "MS_GENERAL_INVALID_MANAGER",
|
|
269
|
+
INTENT_MISSING = "MS_INTENT_MISSING",
|
|
270
|
+
MANAGER_INIT_FAILED = "MS_MANAGER_INIT_FAILED",
|
|
271
|
+
MANAGER_INVALID_CONFIG = "MS_MANAGER_INVALID_CONFIG",
|
|
272
|
+
MANAGER_SHUTDOWN_FAILED = "MS_MANAGER_SHUTDOWN_FAILED",
|
|
273
|
+
MANAGER_NO_NODES = "MS_MANAGER_NO_NODES",
|
|
274
|
+
MANAGER_NODE_NOT_FOUND = "MS_MANAGER_NODE_NOT_FOUND",
|
|
275
|
+
MANAGER_SEARCH_FAILED = "MS_MANAGER_SEARCH_FAILED",
|
|
276
|
+
MANAGER_CLEANUP_INACTIVE_PLAYERS_FAILED = "MS_MANAGER_CLEANUP_INACTIVE_PLAYERS_FAILED",
|
|
277
|
+
NODE_INVALID_CONFIG = "MS_NODE_INVALID_CONFIG",
|
|
278
|
+
NODE_CONNECT_FAILED = "MS_NODE_CONNECT_FAILED",
|
|
279
|
+
NODE_RECONNECT_FAILED = "MS_NODE_RECONNECT_FAILED",
|
|
280
|
+
NODE_DISCONNECTED = "MS_NODE_DISCONNECTED",
|
|
281
|
+
NODE_PROTOCOL_ERROR = "MS_NODE_PROTOCOL_ERROR",
|
|
282
|
+
NODE_SESSION_IDS_LOAD_FAILED = "MS_NODE_SESSION_IDS_LOAD_FAILED",
|
|
283
|
+
NODE_SESSION_IDS_UPDATE_FAILED = "MS_NODE_SESSION_IDS_UPDATE_FAILED",
|
|
284
|
+
NODE_PLUGIN_ERROR = "MS_NODE_PLUGIN_ERROR",
|
|
285
|
+
PLAYER_INVALID_CONFIG = "MS_PLAYER_INVALID_CONFIG",
|
|
286
|
+
PLAYER_STATE_INVALID = "MS_PLAYER_STATE_INVALID",
|
|
287
|
+
PLAYER_QUEUE_EMPTY = "MS_PLAYER_QUEUE_EMPTY",
|
|
288
|
+
PLAYER_PREVIOUS_EMPTY = "MS_PLAYER_PREVIOUS_EMPTY",
|
|
289
|
+
PLAYER_INVALID_NOW_PLAYING_MESSAGE = "MS_PLAYER_INVALID_NOW_PLAYING_MESSAGE",
|
|
290
|
+
PLAYER_INVALID_AUTOPLAY = "MS_PLAYER_INVALID_AUTOPLAY",
|
|
291
|
+
PLAYER_INVALID_VOLUME = "MS_PLAYER_INVALID_VOLUME",
|
|
292
|
+
PLAYER_INVALID_REPEAT = "MS_PLAYER_INVALID_REPEAT",
|
|
293
|
+
PLAYER_INVALID_PAUSE = "MS_PLAYER_INVALID_PAUSE",
|
|
294
|
+
PLAYER_INVALID_SEEK = "MS_PLAYER_INVALID_SEEK",
|
|
295
|
+
PLAYER_MOVE_FAILED = "MS_PLAYER_MOVE_FAILED",
|
|
296
|
+
PLAYER_VOICE_RECEIVER_ERROR = "MS_PLAYER_VOICE_RECEIVER_ERROR",
|
|
297
|
+
QUEUE_REDIS_ERROR = "MS_QUEUE_REDIS_ERROR",
|
|
298
|
+
QUEUE_JSON_ERROR = "MS_QUEUE_JSON_ERROR",
|
|
299
|
+
QUEUE_MEMORY_ERROR = "MS_QUEUE_MEMORY_ERROR",
|
|
300
|
+
FILTER_APPLY_FAILED = "MS_FILTER_APPLY_FAILED",
|
|
301
|
+
REST_REQUEST_FAILED = "MS_REST_REQUEST_FAILED",
|
|
302
|
+
REST_UNAUTHORIZED = "MS_REST_UNAUTHORIZED",
|
|
303
|
+
UTILS_TRACK_PARTIAL_INVALID = "MS_UTILS_TRACK_PARTIAL_INVALID",
|
|
304
|
+
UTILS_TRACK_BUILD_FAILED = "MS_UTILS_TRACK_BUILD_FAILED",
|
|
305
|
+
UTILS_AUTOPLAY_BUILD_FAILED = "MS_UTILS_AUTOPLAY_BUILD_FAILED",
|
|
306
|
+
UTILS_PLAYER_SERIALIZE_FAILED = "MS_UTILS_PLAYER_SERIALIZE_FAILED",
|
|
307
|
+
PLUGIN_LOAD_FAILED = "MS_PLUGIN_LOAD_FAILED",
|
|
308
|
+
PLUGIN_RUNTIME_ERROR = "MS_PLUGIN_RUNTIME_ERROR"
|
|
309
|
+
}
|
|
310
|
+
export declare const MagmaStreamErrorNumbers: Record<MagmaStreamErrorCode, number>;
|
package/dist/structures/Enums.js
CHANGED
|
@@ -163,6 +163,8 @@ var TrackPartial;
|
|
|
163
163
|
TrackPartial["PluginInfo"] = "pluginInfo";
|
|
164
164
|
/** The custom data of the track */
|
|
165
165
|
TrackPartial["CustomData"] = "customData";
|
|
166
|
+
/** Whether the track got autoplayed */
|
|
167
|
+
TrackPartial["IsAutoPlay"] = "isAutoplay";
|
|
166
168
|
})(TrackPartial || (exports.TrackPartial = TrackPartial = {}));
|
|
167
169
|
/**
|
|
168
170
|
* Manager Event Types Enum
|
|
@@ -283,6 +285,7 @@ var MagmaStreamErrorCode;
|
|
|
283
285
|
MagmaStreamErrorCode["GENERAL_UNKNOWN"] = "MS_GENERAL_UNKNOWN";
|
|
284
286
|
MagmaStreamErrorCode["GENERAL_TIMEOUT"] = "MS_GENERAL_TIMEOUT";
|
|
285
287
|
MagmaStreamErrorCode["GENERAL_INVALID_MANAGER"] = "MS_GENERAL_INVALID_MANAGER";
|
|
288
|
+
MagmaStreamErrorCode["INTENT_MISSING"] = "MS_INTENT_MISSING";
|
|
286
289
|
// MANAGER (1100)
|
|
287
290
|
MagmaStreamErrorCode["MANAGER_INIT_FAILED"] = "MS_MANAGER_INIT_FAILED";
|
|
288
291
|
MagmaStreamErrorCode["MANAGER_INVALID_CONFIG"] = "MS_MANAGER_INVALID_CONFIG";
|
|
@@ -326,6 +329,7 @@ var MagmaStreamErrorCode;
|
|
|
326
329
|
MagmaStreamErrorCode["UTILS_TRACK_PARTIAL_INVALID"] = "MS_UTILS_TRACK_PARTIAL_INVALID";
|
|
327
330
|
MagmaStreamErrorCode["UTILS_TRACK_BUILD_FAILED"] = "MS_UTILS_TRACK_BUILD_FAILED";
|
|
328
331
|
MagmaStreamErrorCode["UTILS_AUTOPLAY_BUILD_FAILED"] = "MS_UTILS_AUTOPLAY_BUILD_FAILED";
|
|
332
|
+
MagmaStreamErrorCode["UTILS_PLAYER_SERIALIZE_FAILED"] = "MS_UTILS_PLAYER_SERIALIZE_FAILED";
|
|
329
333
|
// PLUGIN (1800)
|
|
330
334
|
MagmaStreamErrorCode["PLUGIN_LOAD_FAILED"] = "MS_PLUGIN_LOAD_FAILED";
|
|
331
335
|
MagmaStreamErrorCode["PLUGIN_RUNTIME_ERROR"] = "MS_PLUGIN_RUNTIME_ERROR";
|
|
@@ -336,6 +340,7 @@ exports.MagmaStreamErrorNumbers = {
|
|
|
336
340
|
[MagmaStreamErrorCode.GENERAL_UNKNOWN]: 1000,
|
|
337
341
|
[MagmaStreamErrorCode.GENERAL_TIMEOUT]: 1001,
|
|
338
342
|
[MagmaStreamErrorCode.GENERAL_INVALID_MANAGER]: 1002,
|
|
343
|
+
[MagmaStreamErrorCode.INTENT_MISSING]: 1003,
|
|
339
344
|
// MANAGER
|
|
340
345
|
[MagmaStreamErrorCode.MANAGER_INIT_FAILED]: 1100,
|
|
341
346
|
[MagmaStreamErrorCode.MANAGER_INVALID_CONFIG]: 1101,
|
|
@@ -379,6 +384,7 @@ exports.MagmaStreamErrorNumbers = {
|
|
|
379
384
|
[MagmaStreamErrorCode.UTILS_TRACK_PARTIAL_INVALID]: 1700,
|
|
380
385
|
[MagmaStreamErrorCode.UTILS_TRACK_BUILD_FAILED]: 1701,
|
|
381
386
|
[MagmaStreamErrorCode.UTILS_AUTOPLAY_BUILD_FAILED]: 1702,
|
|
387
|
+
[MagmaStreamErrorCode.UTILS_PLAYER_SERIALIZE_FAILED]: 1703,
|
|
382
388
|
// PLUGIN
|
|
383
389
|
[MagmaStreamErrorCode.PLUGIN_LOAD_FAILED]: 1800,
|
|
384
390
|
[MagmaStreamErrorCode.PLUGIN_RUNTIME_ERROR]: 1801,
|