Skip to content

Commit

Permalink
refactor(lava-queue): new getters (#1050)
Browse files Browse the repository at this point in the history
  • Loading branch information
vijayymmeena authored Jun 17, 2024
1 parent 1e32041 commit 67abd09
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
6 changes: 6 additions & 0 deletions packages/lava-queue/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @discordx/lava-queue

## 4.0.1

### Patch Changes

- new getters

## 4.0.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/lava-queue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@discordx/lava-queue",
"version": "4.0.0",
"version": "4.0.1",
"private": false,
"description": "Queue system for @discordx/lava-player",
"keywords": [
Expand Down
21 changes: 18 additions & 3 deletions packages/lava-queue/src/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,22 @@ export class Queue {
return this.queueManager.node.guildPlayerStore.get(this.guildId);
}

get http() {
return this.guildPlayer.http;
}

get node() {
return this.guildPlayer.node;
}

get rest() {
return this.guildPlayer.rest;
}

get sessionId() {
return this.node.sessionId;
}

constructor(
private queueManager: QueueManager,
public guildId: string,
Expand Down Expand Up @@ -161,8 +177,7 @@ export class Queue {
return null;
}

const player = this.queueManager.node.guildPlayerStore.get(this.guildId);
await player.update({ track: { encoded: track.encoded } });
await this.guildPlayer.update({ track: { encoded: track.encoded } });
this._currentPlaybackTrack = track;
return track;
}
Expand Down Expand Up @@ -190,7 +205,7 @@ export class Queue {
* @returns The response from the Lavalink search.
*/
search(text: string): Promise<TrackResponse> {
return this.guildPlayer.rest.loadTracks(text);
return this.rest.loadTracks(text);
}

/**
Expand Down

0 comments on commit 67abd09

Please sign in to comment.