magmastream 2.9.3-dev.3 → 2.9.3-dev.4

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/index.d.ts CHANGED
@@ -170,7 +170,9 @@ declare enum TrackPartial {
170
170
  /** The plugin info of the track */
171
171
  PluginInfo = "pluginInfo",
172
172
  /** The custom data of the track */
173
- CustomData = "customData"
173
+ CustomData = "customData",
174
+ /** Whether the track got autoplayed */
175
+ IsAutoPlay = "isAutoplay"
174
176
  }
175
177
  /**
176
178
  * Manager Event Types Enum
@@ -1189,7 +1191,7 @@ interface Track {
1189
1191
  pluginInfo: TrackPluginInfo;
1190
1192
  /** Add your own data to the track. */
1191
1193
  customData: Record<string, unknown>;
1192
- /** If the track is autoplayed. */
1194
+ /** If the track got added by autoplay. */
1193
1195
  readonly isAutoplay: boolean;
1194
1196
  }
1195
1197
  /**
@@ -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
@@ -260,6 +260,9 @@ class Player {
260
260
  */
261
261
  async destroy(disconnect = true) {
262
262
  this.state = Enums_1.StateTypes.Destroying;
263
+ await this.queue.clear();
264
+ await this.queue.clearPrevious();
265
+ await this.queue.setCurrent(null);
263
266
  if (disconnect) {
264
267
  await this.disconnect().catch((err) => {
265
268
  console.warn(`[Player#destroy] Failed to disconnect player ${this.guildId}:`, err);
@@ -268,9 +271,6 @@ class Player {
268
271
  await this.node.rest.destroyPlayer(this.guildId).catch((err) => {
269
272
  console.warn(`[Player#destroy] REST failed to destroy player ${this.guildId}:`, err);
270
273
  });
271
- await this.queue.clear();
272
- await this.queue.clearPrevious();
273
- await this.queue.setCurrent(null);
274
274
  this.manager.emit(Enums_1.ManagerEventTypes.PlayerDestroy, this);
275
275
  const deleted = this.manager.players.delete(this.guildId);
276
276
  if (this.manager.options.stateStorage.deleteInactivePlayers)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magmastream",
3
- "version": "2.9.3-dev.3",
3
+ "version": "2.9.3-dev.4",
4
4
  "description": "A user-friendly Lavalink client designed for NodeJS.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",