magmastream 2.10.0 → 2.10.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.
@@ -388,8 +388,11 @@ class Player {
388
388
  await this.node.rest.updatePlayer({
389
389
  guildId: this.guildId,
390
390
  data: {
391
- encodedTrack: (await this.queue.getCurrent()).track,
391
+ track: {
392
+ encoded: (await this.queue.getCurrent()).track,
393
+ },
392
394
  ...finalOptions,
395
+ position: finalOptions.startTime || 0,
393
396
  },
394
397
  });
395
398
  this.playing = true;
@@ -694,7 +697,10 @@ class Player {
694
697
  guildId: this.guildId,
695
698
  data: {
696
699
  position: 0,
697
- encodedTrack: (await this.queue.getCurrent())?.track,
700
+ track: {
701
+ encoded: (await this.queue.getCurrent())?.track,
702
+ userData: (await this.queue.getCurrent())?.requester,
703
+ },
698
704
  },
699
705
  });
700
706
  return this;
@@ -730,7 +736,7 @@ class Player {
730
736
  this.node.rest.updatePlayer({
731
737
  guildId: this.guildId,
732
738
  data: {
733
- encodedTrack: null,
739
+ track: null,
734
740
  },
735
741
  });
736
742
  this.manager.emit(Enums_1.ManagerEventTypes.PlayerStateUpdate, oldPlayer, this, {
@@ -940,7 +946,13 @@ class Player {
940
946
  this.manager.players.set(this.guildId, this);
941
947
  await this.node.rest.updatePlayer({
942
948
  guildId: this.guildId,
943
- data: { paused: this.paused, volume: this.volume, position: playerPosition, encodedTrack: currentTrack?.track, voice: { token, endpoint, sessionId, channelId } },
949
+ data: {
950
+ paused: this.paused,
951
+ volume: this.volume,
952
+ position: playerPosition,
953
+ track: { encoded: currentTrack?.track },
954
+ voice: { token, endpoint, sessionId, channelId },
955
+ },
944
956
  });
945
957
  await this.filters.updateFilters();
946
958
  }
@@ -1069,28 +1069,32 @@ export interface PlayOptions {
1069
1069
  * RestPlayOptions interface
1070
1070
  */
1071
1071
  export interface RestPlayOptions {
1072
+ /** The guild ID the Player belongs to. */
1072
1073
  guildId: string;
1074
+ /** Whether to not replace the track if a play payload is sent. */
1075
+ noReplace?: boolean;
1073
1076
  data: {
1074
1077
  /** The base64 encoded track. */
1075
- encodedTrack?: string;
1076
- /** The track ID. */
1077
- identifier?: string;
1078
- /** The track time to start at. */
1079
- startTime?: number;
1078
+ track?: {
1079
+ /** The base64 encoded track. */
1080
+ encoded?: string | null;
1081
+ /** The track ID. */
1082
+ identifier?: string | null;
1083
+ /** The user data of the track. */
1084
+ userData?: object;
1085
+ };
1086
+ /** The player position in a track. */
1087
+ position?: number;
1080
1088
  /** The track time to end at. */
1081
1089
  endTime?: number;
1082
1090
  /** The player volume level. */
1083
1091
  volume?: number;
1084
- /** The player position in a track. */
1085
- position?: number;
1086
1092
  /** Whether the player is paused. */
1087
1093
  paused?: boolean;
1088
1094
  /** The audio effects. */
1089
1095
  filters?: object;
1090
1096
  /** voice payload. */
1091
1097
  voice?: LavalinkVoiceStateUpdate;
1092
- /** Whether to not replace the track if a play payload is sent. */
1093
- noReplace?: boolean;
1094
1098
  };
1095
1099
  }
1096
1100
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magmastream",
3
- "version": "2.10.0",
3
+ "version": "2.10.1-dev.0",
4
4
  "description": "A user-friendly Lavalink client designed for NodeJS.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -100,9 +100,9 @@
100
100
  ],
101
101
  "repository": {
102
102
  "type": "git",
103
- "url": "git+https://gitryx.com/MagmaStream/magmastream.git#main"
103
+ "url": "https://gitryx.com/MagmaStream/magmastream.git"
104
104
  },
105
105
  "homepage": "https://docs.magmastream.com",
106
106
  "author": "Abel Purnwasy",
107
107
  "license": "Apache-2.0"
108
- }
108
+ }