magmastream 2.9.0-dev.12 → 2.9.0-dev.13
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/README.md +1 -1
- package/dist/structures/Node.js +5 -2
- package/dist/structures/Player.js +2 -2
- package/dist/structures/Queue.js +4 -4
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
| [Stal](https://discord.com/oauth2/authorize?client_id=923938180263182356&scope=bot%20applications.commands&permissions=27648861246) | memte |
|
|
96
96
|
| [Lunio](https://discord.com/api/oauth2/authorize?client_id=945030475779551415&permissions=61991952&scope=bot+applications.commands) | vexi |
|
|
97
97
|
| [JukeDisc](https://discord.com/oauth2/authorize?client_id=1109751797549105176&permissions=968552214080&scope=bot+applications.commands) | Theo |
|
|
98
|
-
| [
|
|
98
|
+
| [Leo](https://discord.com/oauth2/authorize?client_id=923529398425096193&permissions=12888394808&scope=bot%20identify%20applications.commands) | Itz Random |
|
|
99
99
|
| [Soundy](https://dsc.gg/sndy) | iaMJ |
|
|
100
100
|
| [HamBot](https://discord.com/oauth2/authorize?client_id=1049314312776335390) | yanishamburger|
|
|
101
101
|
| [Miyu](https://discord.com/oauth2/authorize?client_id=1277180179273482280&permissions=572851999731703&response_type=code&redirect_uri=https%3A%2F%2Fdiscord.gg%2Ftn3nbFB8nX&integration_type=0&scope=identify+applications.commands+bot) | Kenver |
|
package/dist/structures/Node.js
CHANGED
|
@@ -542,8 +542,11 @@ class Node {
|
|
|
542
542
|
// Store the current track in the previous tracks queue
|
|
543
543
|
await player.queue.addPrevious(await player.queue.getCurrent());
|
|
544
544
|
// Limit the previous tracks queue to maxPreviousTracks
|
|
545
|
-
|
|
546
|
-
|
|
545
|
+
const previous = await player.queue.getPrevious();
|
|
546
|
+
if (previous.length > this.manager.options.maxPreviousTracks) {
|
|
547
|
+
previous.shift();
|
|
548
|
+
await player.queue.clearPrevious();
|
|
549
|
+
await player.queue.addPrevious(previous);
|
|
547
550
|
}
|
|
548
551
|
}
|
|
549
552
|
const oldPlayer = player;
|
|
@@ -798,7 +798,7 @@ class Player {
|
|
|
798
798
|
if (!newOptions.textChannelId)
|
|
799
799
|
throw new Error("Text channel ID is required");
|
|
800
800
|
// Check if a player already exists for the new guild
|
|
801
|
-
let newPlayer =
|
|
801
|
+
let newPlayer = this.manager.getPlayer(newOptions.guildId);
|
|
802
802
|
// If the player already exists and force is false, return the existing player
|
|
803
803
|
if (newPlayer && !force)
|
|
804
804
|
return newPlayer;
|
|
@@ -831,7 +831,7 @@ class Player {
|
|
|
831
831
|
newOptions.selfMute = newOptions.selfMute ?? oldPlayerProperties.selfMute;
|
|
832
832
|
newOptions.volume = newOptions.volume ?? oldPlayerProperties.volume;
|
|
833
833
|
// Deep clone the current player
|
|
834
|
-
const clonedPlayer =
|
|
834
|
+
const clonedPlayer = this.manager.create(newOptions);
|
|
835
835
|
// Connect the cloned player to the new voice channel
|
|
836
836
|
clonedPlayer.connect();
|
|
837
837
|
// Update the player's state on the Lavalink node
|
package/dist/structures/Queue.js
CHANGED
|
@@ -211,7 +211,7 @@ class Queue extends Array {
|
|
|
211
211
|
// Remove all items from the queue.
|
|
212
212
|
this.splice(0);
|
|
213
213
|
// Emit an event to update the player state indicating the queue has been cleared.
|
|
214
|
-
this.manager.emit(Manager_1.ManagerEventTypes.PlayerStateUpdate, oldPlayer,
|
|
214
|
+
this.manager.emit(Manager_1.ManagerEventTypes.PlayerStateUpdate, oldPlayer, this.manager.players.get(this.guildId), {
|
|
215
215
|
changeType: Manager_1.PlayerStateEventTypes.QueueChange,
|
|
216
216
|
details: {
|
|
217
217
|
changeType: "clear",
|
|
@@ -236,7 +236,7 @@ class Queue extends Array {
|
|
|
236
236
|
[this[i], this[j]] = [this[j], this[i]];
|
|
237
237
|
}
|
|
238
238
|
// Emit an event to update the player state indicating the queue has been shuffled.
|
|
239
|
-
this.manager.emit(Manager_1.ManagerEventTypes.PlayerStateUpdate, oldPlayer,
|
|
239
|
+
this.manager.emit(Manager_1.ManagerEventTypes.PlayerStateUpdate, oldPlayer, this.manager.players.get(this.guildId), {
|
|
240
240
|
changeType: Manager_1.PlayerStateEventTypes.QueueChange,
|
|
241
241
|
details: {
|
|
242
242
|
changeType: "shuffle",
|
|
@@ -278,7 +278,7 @@ class Queue extends Array {
|
|
|
278
278
|
this.splice(0);
|
|
279
279
|
this.add(shuffledQueue);
|
|
280
280
|
// Emit an event to update the player state indicating the queue has been shuffled.
|
|
281
|
-
this.manager.emit(Manager_1.ManagerEventTypes.PlayerStateUpdate, oldPlayer,
|
|
281
|
+
this.manager.emit(Manager_1.ManagerEventTypes.PlayerStateUpdate, oldPlayer, this.manager.players.get(this.guildId), {
|
|
282
282
|
changeType: Manager_1.PlayerStateEventTypes.QueueChange,
|
|
283
283
|
details: {
|
|
284
284
|
changeType: "userBlock",
|
|
@@ -330,7 +330,7 @@ class Queue extends Array {
|
|
|
330
330
|
this.splice(0);
|
|
331
331
|
this.add(shuffledQueue);
|
|
332
332
|
// Emit an event to update the player state indicating the queue has been shuffled.
|
|
333
|
-
this.manager.emit(Manager_1.ManagerEventTypes.PlayerStateUpdate, oldPlayer,
|
|
333
|
+
this.manager.emit(Manager_1.ManagerEventTypes.PlayerStateUpdate, oldPlayer, this.manager.players.get(this.guildId), {
|
|
334
334
|
changeType: Manager_1.PlayerStateEventTypes.QueueChange,
|
|
335
335
|
details: {
|
|
336
336
|
changeType: "roundRobin",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "magmastream",
|
|
3
|
-
"version": "2.9.0-dev.
|
|
3
|
+
"version": "2.9.0-dev.13",
|
|
4
4
|
"description": "A user-friendly Lavalink client designed for NodeJS.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -17,22 +17,22 @@
|
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@favware/rollup-type-bundler": "^4.0.0",
|
|
19
19
|
"@types/lodash": "^4.17.16",
|
|
20
|
-
"@types/node": "^22.
|
|
20
|
+
"@types/node": "^22.15.2",
|
|
21
21
|
"@types/ws": "^8.18.1",
|
|
22
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
23
|
-
"@typescript-eslint/parser": "^8.
|
|
24
|
-
"eslint": "^9.
|
|
22
|
+
"@typescript-eslint/eslint-plugin": "^8.31.0",
|
|
23
|
+
"@typescript-eslint/parser": "^8.31.0",
|
|
24
|
+
"eslint": "^9.25.1",
|
|
25
25
|
"npm-run-all": "^4.1.5",
|
|
26
26
|
"typedoc": "^0.27.9",
|
|
27
|
-
"typedoc-plugin-no-inherit": "^1.
|
|
28
|
-
"typescript": "^5.8.
|
|
27
|
+
"typedoc-plugin-no-inherit": "^1.6.1",
|
|
28
|
+
"typescript": "^5.8.3"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@discordjs/collection": "^2.1.1",
|
|
32
|
-
"axios": "^1.
|
|
32
|
+
"axios": "^1.9.0",
|
|
33
33
|
"events": "^3.3.0",
|
|
34
|
-
"ioredis": "^5.6.
|
|
35
|
-
"jsdom": "^26.
|
|
34
|
+
"ioredis": "^5.6.1",
|
|
35
|
+
"jsdom": "^26.1.0",
|
|
36
36
|
"lodash": "^4.17.21",
|
|
37
37
|
"tslib": "^2.8.1",
|
|
38
38
|
"ws": "^8.18.1"
|