From 30d126fdf8503d026bb5080ad35bd431e2bc8983 Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 2 Feb 2025 17:24:20 -0500 Subject: [PATCH 01/41] Add Documentation --- README.md | 228 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 227 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ab0aad..ded01d0 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,229 @@ # LavaQueue -yes, no docs lol. \ No newline at end of file +> [!IMPORTANT] +> This plugin is compatible with Lavalink version four and higher. + +A plugin that adds a queue system for [Lavalink](https://github.com/lavalink-devs/Lavalink). + +## Summary + +* [Installation](#installation) +* [Lavalink Usage](#lavalink-usage) + +## Installation + +To install this plugin either download the latest release and place it into your `plugins` folder or add the following into your `application.yml` + +Replace x.y.z with the latest version number or short commit hash. + +```yaml +lavalink: + plugins: + - dependency: "com.github.topi314.lavaqueue:lavaqueue-plugin:x.y.z" + snapshot: false # set to true if you want to use snapshot builds (see below) +``` + +Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the short commit hash as the version. + +## Lavalink Usage + +### Queue Types: + +* `normal` +* `repeat` +* `track` + +--- + +### Get Queue + +``` +GET /sessions/{sessionId}/players/{guildId}/queue +``` + +Response: + +```json5 +{ + "type": "normal", + "tracks": [ + { + "encoded": "...", + "info": "{}", + "pluginInfo": "{}", + "userData": "{}" + } + ] +} +``` + +--- + +### Update Queue + +Modifies the queue. Overrides the existing tracks if the tracks key is present. + +``` +PATCH /sessions/{sessionId}/players/{playerId}/queue +``` + +Request: + +```json5 +{ + "type": "normal", + "tracks": [ + { + "encoded":"QAAAjQIAJVJpY2sgQXN0bGV5IC0gTmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXAADlJpY2tBc3RsZXlWRVZPAAAAAAADPCAAC2RRd" + } + ] +} +``` + +--- + +### Next Queue Track + +Gets the next track in the queue. Plays the next track if the player isn't playing. Response is a [track](https://lavalink.dev/api/rest#track) object. + +``` +GET /sessions/{sessionId}/players/{guildId}/queue/next +``` + +--- + +### Previous Queue Track + +Gets the previously playing track. Plays the previous track if the player isn't playing. Response is a [track](https://lavalink.dev/api/rest#track) object. + +``` +GET /sessions/{sessionId}/players/{guildId}/queue +``` + +--- + +### Add Queue Tracks + +Adds tracks to the queue. Response is the next queue [track](https://lavalink.dev/api/rest#track). + +``` +POST /sessions/{sessionId}/players/{guildId}/queue/tracks +``` + +Request: + +```json5 +{ + [ + { + "encoded": "QAAAjQIAJVJpY2sgQXN0bGV5IC0gTmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXAADlJpY2tBc3RsZXlWRVZPAAAAAAADPCAAC2RRd" + } + ] +} +``` + +--- + +### Update Queue Tracks + +Overrides the existing tracks in the queue. Response is the next queue [track](https://lavalink.dev/api/rest#track). + +``` +PUT /sessions/{sessionId}/players/{guildId}/queue/tracks +``` + +Request: + +```json5 +{ + [ + { + "encoded": "QAAAjQIAJVJpY2sgQXN0bGV5IC0gTmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXAADlJpY2tBc3RsZXlWRVZPAAAAAAADPCAAC2RRd" + } + ] +} +``` + +--- + +### Delete Queue + +``` +DELETE /sessions/{sessionId}/players/{guildId}/tracks/queue +``` + +--- + +### Get Queue Track + +Gets a track from the queue at the specified index. Response is a [track](https://lavalink.dev/api/rest#track) object. + +``` +GET /sessions/{sessionId}/players/{guildId}/queue/tracks/{index} +``` + +--- + +### Add Queue Track + +Adds a track at the specified index. Reuqest body is an [update player track](https://lavalink.dev/api/rest#update-player-track). + +``` +PUT /sessions/{sessionId}/players/{guildId}/queue/tracks/{index} +``` + +--- + +### Delete Queue Track(s) + +Deletes a track from the queue. If amount is provided, the specified number of elements after the index will be removed. + +``` +DELETE /sessions/{sessionId}/players/{guildId}/queue/{index}?amount=0 +``` + +--- + +### Move Queue Track + +Move a track to a different position. This does *not* remove the track at the original index. + +``` +POST /sessions/{sessionId}/players/{guildId}/queue/{index}/move?position=0 +``` + +--- + +### Get Queue History + +Gets the history of this queue. Response is an array of [track](https://lavalink.dev/api/rest#track) objects. + +``` +GET /sessions/{sessionId}/players/{guildId}/history +``` + +--- + +### Get Queue History Track + +Gets a track from the history at the specified index. Response is a [track](https://lavalink.dev/api/rest#track) object. + +``` +GET /sessions/{sessionId}/players/{guildId}/history/{index} +``` + +--- + +## Events + +One new event has been added. + +### QueueEndEvent + +```json5 +{ + "op": "event", + "type": "QueueEndEvent", + "guildId": "...", +} +``` From a70632362598a93d8929806361373c16c9bd2103 Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 2 Feb 2025 17:30:22 -0500 Subject: [PATCH 02/41] Fix Incorrect Verbs --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ded01d0..e75b6af 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ Request: Gets the next track in the queue. Plays the next track if the player isn't playing. Response is a [track](https://lavalink.dev/api/rest#track) object. ``` -GET /sessions/{sessionId}/players/{guildId}/queue/next +POST /sessions/{sessionId}/players/{guildId}/queue/next ``` --- @@ -97,7 +97,7 @@ GET /sessions/{sessionId}/players/{guildId}/queue/next Gets the previously playing track. Plays the previous track if the player isn't playing. Response is a [track](https://lavalink.dev/api/rest#track) object. ``` -GET /sessions/{sessionId}/players/{guildId}/queue +POST /sessions/{sessionId}/players/{guildId}/queue ``` --- From 8389b71437681361f00aad327d83a24df27f58ff Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 2 Feb 2025 17:31:03 -0500 Subject: [PATCH 03/41] Fix Incorrect URL Path --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e75b6af..275988b 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ POST /sessions/{sessionId}/players/{guildId}/queue/next Gets the previously playing track. Plays the previous track if the player isn't playing. Response is a [track](https://lavalink.dev/api/rest#track) object. ``` -POST /sessions/{sessionId}/players/{guildId}/queue +POST /sessions/{sessionId}/players/{guildId}/queue/previous ``` --- From 8919e08c3fa0ecb25ebc5314cb96d817e27ffb1c Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 2 Feb 2025 18:12:34 -0500 Subject: [PATCH 04/41] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Toπ --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 275988b..ad2fbe9 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ # LavaQueue > [!IMPORTANT] -> This plugin is compatible with Lavalink version four and higher. +> This plugin *requires* Lavalink `v4.0.5` or greater A plugin that adds a queue system for [Lavalink](https://github.com/lavalink-devs/Lavalink). ## Summary * [Installation](#installation) -* [Lavalink Usage](#lavalink-usage) +* [API](#api) ## Installation @@ -25,9 +25,12 @@ lavalink: Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the short commit hash as the version. -## Lavalink Usage +## API -### Queue Types: +The plugin provides a REST API to add, remove and update tracks in the queue. + + +### Queue Types * `normal` * `repeat` From 7273604cd88e9451051536392e89f8cb34fde118 Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 2 Feb 2025 18:21:34 -0500 Subject: [PATCH 05/41] Queue Types Table --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ad2fbe9..1e6c95d 100644 --- a/README.md +++ b/README.md @@ -32,9 +32,11 @@ The plugin provides a REST API to add, remove and update tracks in the queue. ### Queue Types -* `normal` -* `repeat` -* `track` +| Type | Description | +|--------------|--------------------------------------------------------| +| normal | Tracks will be played in the first in first out order. | +| repeat_track | A singular track will be repeatedly played. | +| repeat_queue | The queue will and restart once it has ended. | --- From 63674864adc6d0c6951eb6333c4d0bcdec993480 Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 2 Feb 2025 18:24:36 -0500 Subject: [PATCH 06/41] Update Heading --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1e6c95d..f6b3bff 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ > [!IMPORTANT] > This plugin *requires* Lavalink `v4.0.5` or greater -A plugin that adds a queue system for [Lavalink](https://github.com/lavalink-devs/Lavalink). +A simple queue plugin for [Lavalink](https://github.com/lavalink-devs/Lavalink) with a REST API. ## Summary @@ -36,7 +36,7 @@ The plugin provides a REST API to add, remove and update tracks in the queue. |--------------|--------------------------------------------------------| | normal | Tracks will be played in the first in first out order. | | repeat_track | A singular track will be repeatedly played. | -| repeat_queue | The queue will and restart once it has ended. | +| repeat_queue | The queue will repeat once it has ended. | --- From 5dae2cddcd62fc43cac5446d6eccab1bc207ea9f Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 2 Feb 2025 20:18:18 -0500 Subject: [PATCH 07/41] Add Tables --- README.md | 66 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 45 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index f6b3bff..3020bb0 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,6 @@ lavalink: Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the short commit hash as the version. -## API - -The plugin provides a REST API to add, remove and update tracks in the queue. - - ### Queue Types | Type | Description | @@ -40,13 +35,24 @@ The plugin provides a REST API to add, remove and update tracks in the queue. --- -### Get Queue +### Common Types -``` -GET /sessions/{sessionId}/players/{guildId}/queue -``` +| Type | Description | +|-------------------------------------------------------------------------------|-----------------------------------------------------------| +| [track](https://lavalink.dev/api/rest.html#track) | A track object returned in API responses. | +| [update_player_track](https://lavalink.dev/api/rest.html#update-player-track) | An update player tracks that can be sent in API requests. | + +--- + +### Queue Object -Response: +| Field | Type | Description | +|--------|--------|-----------------------------------------| +| type | string | the type of queue. | +| tracks | array | An array of track objects in the queue. | + +
+Example Payload ```json5 { @@ -62,6 +68,18 @@ Response: } ``` +
+ +## API + +The plugin provides a REST API to add, remove and update tracks in the queue. + +### Get Queue + +``` +GET /sessions/{sessionId}/players/{guildId}/queue +``` + --- ### Update Queue @@ -72,7 +90,8 @@ Modifies the queue. Overrides the existing tracks if the tracks key is present. PATCH /sessions/{sessionId}/players/{playerId}/queue ``` -Request: +
+Example Payload ```json5 { @@ -84,12 +103,13 @@ Request: ] } ``` +
--- ### Next Queue Track -Gets the next track in the queue. Plays the next track if the player isn't playing. Response is a [track](https://lavalink.dev/api/rest#track) object. +Gets the next track in the queue. Plays the next track if the player isn't playing. Response is a track object. ``` POST /sessions/{sessionId}/players/{guildId}/queue/next @@ -99,7 +119,7 @@ POST /sessions/{sessionId}/players/{guildId}/queue/next ### Previous Queue Track -Gets the previously playing track. Plays the previous track if the player isn't playing. Response is a [track](https://lavalink.dev/api/rest#track) object. +Gets the previously playing track. Plays the previous track if the player isn't playing. Response is a track object. ``` POST /sessions/{sessionId}/players/{guildId}/queue/previous @@ -109,13 +129,14 @@ POST /sessions/{sessionId}/players/{guildId}/queue/previous ### Add Queue Tracks -Adds tracks to the queue. Response is the next queue [track](https://lavalink.dev/api/rest#track). +Adds tracks to the queue. Response is the next queue track. ``` POST /sessions/{sessionId}/players/{guildId}/queue/tracks ``` -Request: +
+Example Payload ```json5 { @@ -126,18 +147,20 @@ Request: ] } ``` +
--- ### Update Queue Tracks -Overrides the existing tracks in the queue. Response is the next queue [track](https://lavalink.dev/api/rest#track). +Overrides the existing tracks in the queue. Response is the next queue track. ``` PUT /sessions/{sessionId}/players/{guildId}/queue/tracks ``` -Request: +
+Example Payload ```json5 { @@ -148,6 +171,7 @@ Request: ] } ``` +
--- @@ -161,7 +185,7 @@ DELETE /sessions/{sessionId}/players/{guildId}/tracks/queue ### Get Queue Track -Gets a track from the queue at the specified index. Response is a [track](https://lavalink.dev/api/rest#track) object. +Gets a track from the queue at the specified index. Response is a track object. ``` GET /sessions/{sessionId}/players/{guildId}/queue/tracks/{index} @@ -171,7 +195,7 @@ GET /sessions/{sessionId}/players/{guildId}/queue/tracks/{index} ### Add Queue Track -Adds a track at the specified index. Reuqest body is an [update player track](https://lavalink.dev/api/rest#update-player-track). +Adds a track at the specified index. Reuqest body is an update player track. ``` PUT /sessions/{sessionId}/players/{guildId}/queue/tracks/{index} @@ -201,7 +225,7 @@ POST /sessions/{sessionId}/players/{guildId}/queue/{index}/move?position=0 ### Get Queue History -Gets the history of this queue. Response is an array of [track](https://lavalink.dev/api/rest#track) objects. +Gets the history of this queue. Response is an array of track objects. ``` GET /sessions/{sessionId}/players/{guildId}/history @@ -211,7 +235,7 @@ GET /sessions/{sessionId}/players/{guildId}/history ### Get Queue History Track -Gets a track from the history at the specified index. Response is a [track](https://lavalink.dev/api/rest#track) object. +Gets a track from the history at the specified index. Response is a track object. ``` GET /sessions/{sessionId}/players/{guildId}/history/{index} From 8f2225f4199898816cd73b5e0c78b8114743d8f5 Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 2 Feb 2025 20:52:23 -0500 Subject: [PATCH 08/41] Add Endpoints in Summary --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 3020bb0..140518f 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,18 @@ A simple queue plugin for [Lavalink](https://github.com/lavalink-devs/Lavalink) * [Installation](#installation) * [API](#api) +* [Get Queue](#get-queue) +* [Update Queue](#update-queue) +* [Next Queue Track](#next-queue-track) +* [Previous Queue Track](#previous-queue-track) +* [Add Queue Track](#add-queue-tracks) +* [Update Queue Track](#update-queue-tracks) +* [Get Queue Track](#get-queue-track) +* [Add Queue Track](#add-queue-track) +* [Delete Queue Track(s)](#delete-queue-track(s)) +* [Move Queue Track](#move-queue-track) +* [Get Queue History](#get-queue-history) +* [Get Queue History Track](#get-queue-history-track) ## Installation @@ -70,6 +82,8 @@ Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the +--- + ## API The plugin provides a REST API to add, remove and update tracks in the queue. @@ -249,6 +263,9 @@ One new event has been added. ### QueueEndEvent +
+Example Payload + ```json5 { "op": "event", @@ -256,3 +273,4 @@ One new event has been added. "guildId": "...", } ``` +
\ No newline at end of file From f64049a7555119fddf2e581845a729fcfc6fe2f1 Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 2 Feb 2025 20:57:22 -0500 Subject: [PATCH 09/41] Fix Formatting --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 140518f..cecd77e 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the | Type | Description | |--------------|--------------------------------------------------------| -| normal | Tracks will be played in the first in first out order. | +| normal | Tracks will be played in the order they are added. | | repeat_track | A singular track will be repeatedly played. | | repeat_queue | The queue will repeat once it has ended. | @@ -84,9 +84,9 @@ Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the --- -## API +### API -The plugin provides a REST API to add, remove and update tracks in the queue. +The plugin provides a REST API to add, remove, and update tracks in the queue. ### Get Queue @@ -263,6 +263,8 @@ One new event has been added. ### QueueEndEvent +Fires when a queue has ended. +
Example Payload From af02b101fbcb88e1466529679e476922ce982950 Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 2 Feb 2025 20:58:55 -0500 Subject: [PATCH 10/41] Remove # from heading --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index cecd77e..8b30baf 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the --- -### API +## API The plugin provides a REST API to add, remove, and update tracks in the queue. @@ -259,8 +259,6 @@ GET /sessions/{sessionId}/players/{guildId}/history/{index} ## Events -One new event has been added. - ### QueueEndEvent Fires when a queue has ended. From 532629aa04db8bfba7bf243c50a330b3d21e23c6 Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 2 Feb 2025 21:01:33 -0500 Subject: [PATCH 11/41] Add Backticks --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8b30baf..88eaacf 100644 --- a/README.md +++ b/README.md @@ -39,11 +39,11 @@ Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the ### Queue Types -| Type | Description | -|--------------|--------------------------------------------------------| -| normal | Tracks will be played in the order they are added. | -| repeat_track | A singular track will be repeatedly played. | -| repeat_queue | The queue will repeat once it has ended. | +| Type | Description | +|-----------------|----------------------------------------------------| +| `normal` | Tracks will be played in the order they are added. | +| `repeat_track` | A singular track will be repeatedly played. | +| `repeat_queue ` | The queue will repeat once it has ended. | --- From 70488d24eb0c9978b59826ea4547b78e46807d51 Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 2 Feb 2025 21:04:51 -0500 Subject: [PATCH 12/41] Grammatical Fixes --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 88eaacf..43e55bb 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the |-----------------|----------------------------------------------------| | `normal` | Tracks will be played in the order they are added. | | `repeat_track` | A singular track will be repeatedly played. | -| `repeat_queue ` | The queue will repeat once it has ended. | +| `repeat_queue` | The queue will repeat once it has ended. | --- @@ -52,7 +52,7 @@ Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the | Type | Description | |-------------------------------------------------------------------------------|-----------------------------------------------------------| | [track](https://lavalink.dev/api/rest.html#track) | A track object returned in API responses. | -| [update_player_track](https://lavalink.dev/api/rest.html#update-player-track) | An update player tracks that can be sent in API requests. | +| [update_player_track](https://lavalink.dev/api/rest.html#update-player-track) | An update player track that can be sent in API requests. | --- @@ -90,6 +90,8 @@ The plugin provides a REST API to add, remove, and update tracks in the queue. ### Get Queue +Returns a [queue object](#queue-object). + ``` GET /sessions/{sessionId}/players/{guildId}/queue ``` From a767fe82e8772373130dc72dd409ded1353265f8 Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 2 Feb 2025 21:05:47 -0500 Subject: [PATCH 13/41] Add Extra Divider --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 43e55bb..eb9d2b3 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,8 @@ lavalink: Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the short commit hash as the version. +--- + ### Queue Types | Type | Description | From 6f2ad7e20c17aa140f0804063d007e7004d7e635 Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 2 Feb 2025 21:10:03 -0500 Subject: [PATCH 14/41] Add Optional Fields Notice --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index eb9d2b3..d770e4f 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the | Type | Description | |-------------------------------------------------------------------------------|-----------------------------------------------------------| | [track](https://lavalink.dev/api/rest.html#track) | A track object returned in API responses. | -| [update_player_track](https://lavalink.dev/api/rest.html#update-player-track) | An update player track that can be sent in API requests. | +| [update_player_track](https://lavalink.dev/api/rest.html#update-player-track) | An update player track that can be sent in API requests. | --- @@ -102,6 +102,9 @@ GET /sessions/{sessionId}/players/{guildId}/queue ### Update Queue +> [!NOTE] +> All fields are optional and only the fields you provide will be updated. + Modifies the queue. Overrides the existing tracks if the tracks key is present. ``` From 82c5f3684532e14c88dfd64cc35820a3f4af15fc Mon Sep 17 00:00:00 2001 From: Droid Date: Mon, 3 Feb 2025 15:45:39 -0500 Subject: [PATCH 15/41] fix queue naming, add table for payloads --- README.md | 126 +++++++++++++++++++++--------------------------------- 1 file changed, 49 insertions(+), 77 deletions(-) diff --git a/README.md b/README.md index d770e4f..5786f5b 100644 --- a/README.md +++ b/README.md @@ -9,18 +9,20 @@ A simple queue plugin for [Lavalink](https://github.com/lavalink-devs/Lavalink) * [Installation](#installation) * [API](#api) -* [Get Queue](#get-queue) -* [Update Queue](#update-queue) -* [Next Queue Track](#next-queue-track) -* [Previous Queue Track](#previous-queue-track) -* [Add Queue Track](#add-queue-tracks) -* [Update Queue Track](#update-queue-tracks) -* [Get Queue Track](#get-queue-track) -* [Add Queue Track](#add-queue-track) -* [Delete Queue Track(s)](#delete-queue-track(s)) -* [Move Queue Track](#move-queue-track) -* [Get Queue History](#get-queue-history) -* [Get Queue History Track](#get-queue-history-track) + * [Get Queue](#get-queue) + * [Update Queue](#update-queue) + * [Next Queue Track](#next-queue-track) + * [Previous Queue Track](#previous-queue-track) + * [Add Queue Track](#add-queue-tracks) + * [Update Queue Track](#update-queue-tracks) + * [Get Queue Track](#get-queue-track) + * [Add Queue Track](#add-queue-track) + * [Delete Queue Track(s)](#delete-queue-track(s)) + * [Move Queue Track](#move-queue-track) + * [Get Queue History](#get-queue-history) + * [Get Queue History Track](#get-queue-history-track) +* [Events](#events) + * [QueueEndEvent](#queueendevent) ## Installation @@ -39,7 +41,7 @@ Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the --- -### Queue Types +### Queue Modes | Type | Description | |-----------------|----------------------------------------------------| @@ -49,21 +51,12 @@ Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the --- -### Common Types - -| Type | Description | -|-------------------------------------------------------------------------------|-----------------------------------------------------------| -| [track](https://lavalink.dev/api/rest.html#track) | A track object returned in API responses. | -| [update_player_track](https://lavalink.dev/api/rest.html#update-player-track) | An update player track that can be sent in API requests. | - ---- - ### Queue Object -| Field | Type | Description | -|--------|--------|-----------------------------------------| -| type | string | the type of queue. | -| tracks | array | An array of track objects in the queue. | +| Field | Type | Description | +|----------------------|--------------------------------------------------------------------|-----------------------------------------| +| [mode](#queue-modes) | string | The mode of the queue. | +| tracks | array of [Track](https://lavalink.dev/api/rest.html#track) objects | An array of track objects in the queue. |
Example Payload @@ -74,9 +67,33 @@ Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the "tracks": [ { "encoded": "...", - "info": "{}", - "pluginInfo": "{}", - "userData": "{}" + "info": {}, + "pluginInfo": {}, + "userData": {} + } + ] +} +``` + +
+ +--- + +### Common Types + +| Type | Description | +|---------------------------------------------------|-----------------------------------------------------------------------------------------------| +| [track](https://lavalink.dev/api/rest.html#track) | A track object returned in API responses. | +| `update_queue_payload` | An array of [update player track](https://lavalink.dev/api/rest#update-player-track) objects. | + +
+Example Payload + +```json5 +{ + [ + { + "encoded": "QAAAjQIAJVJpY2sgQXN0bGV5IC0gTmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXAADlJpY2tBc3RsZXlWRVZPAAAAAAADPCAAC2RRd" } ] } @@ -92,40 +109,23 @@ The plugin provides a REST API to add, remove, and update tracks in the queue. ### Get Queue -Returns a [queue object](#queue-object). - ``` GET /sessions/{sessionId}/players/{guildId}/queue ``` ---- +Response: [Queue Object](#queue-object) -### Update Queue +--- > [!NOTE] > All fields are optional and only the fields you provide will be updated. -Modifies the queue. Overrides the existing tracks if the tracks key is present. +Modifies the queue. Overrides the existing tracks if the tracks key is present. Request body is a [queue object](#queue-object). ``` PATCH /sessions/{sessionId}/players/{playerId}/queue ``` -
-Example Payload - -```json5 -{ - "type": "normal", - "tracks": [ - { - "encoded":"QAAAjQIAJVJpY2sgQXN0bGV5IC0gTmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXAADlJpY2tBc3RsZXlWRVZPAAAAAAADPCAAC2RRd" - } - ] -} -``` -
- --- ### Next Queue Track @@ -156,20 +156,6 @@ Adds tracks to the queue. Response is the next queue track. POST /sessions/{sessionId}/players/{guildId}/queue/tracks ``` -
-Example Payload - -```json5 -{ - [ - { - "encoded": "QAAAjQIAJVJpY2sgQXN0bGV5IC0gTmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXAADlJpY2tBc3RsZXlWRVZPAAAAAAADPCAAC2RRd" - } - ] -} -``` -
- --- ### Update Queue Tracks @@ -180,20 +166,6 @@ Overrides the existing tracks in the queue. Response is the next queue track. PUT /sessions/{sessionId}/players/{guildId}/queue/tracks ``` -
-Example Payload - -```json5 -{ - [ - { - "encoded": "QAAAjQIAJVJpY2sgQXN0bGV5IC0gTmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXAADlJpY2tBc3RsZXlWRVZPAAAAAAADPCAAC2RRd" - } - ] -} -``` -
- --- ### Delete Queue From da0aefbd43338b5241524a999c2d6a8853c0bfed Mon Sep 17 00:00:00 2001 From: Droid Date: Mon, 3 Feb 2025 15:57:36 -0500 Subject: [PATCH 16/41] Format Tables --- README.md | 56 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 5786f5b..d89bde1 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the | Type | Description | |-----------------|----------------------------------------------------| | `normal` | Tracks will be played in the order they are added. | -| `repeat_track` | A singular track will be repeatedly played. | +| `repeat_track` | A single track will be repeatedly played. | | `repeat_queue` | The queue will repeat once it has ended. | --- @@ -84,10 +84,10 @@ Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the | Type | Description | |---------------------------------------------------|-----------------------------------------------------------------------------------------------| | [track](https://lavalink.dev/api/rest.html#track) | A track object returned in API responses. | -| `update_queue_payload` | An array of [update player track](https://lavalink.dev/api/rest#update-player-track) objects. | +| `update_queue` | An array of [update player track](https://lavalink.dev/api/rest#update-player-track) objects. |
-Example Payload +Update Queue Payload ```json5 { @@ -109,7 +109,7 @@ The plugin provides a REST API to add, remove, and update tracks in the queue. ### Get Queue -``` +```http GET /sessions/{sessionId}/players/{guildId}/queue ``` @@ -122,118 +122,142 @@ Response: [Queue Object](#queue-object) Modifies the queue. Overrides the existing tracks if the tracks key is present. Request body is a [queue object](#queue-object). -``` +```http PATCH /sessions/{sessionId}/players/{playerId}/queue ``` +Response: + --- ### Next Queue Track Gets the next track in the queue. Plays the next track if the player isn't playing. Response is a track object. -``` +```http POST /sessions/{sessionId}/players/{guildId}/queue/next ``` +Response: + --- ### Previous Queue Track Gets the previously playing track. Plays the previous track if the player isn't playing. Response is a track object. -``` +```http POST /sessions/{sessionId}/players/{guildId}/queue/previous ``` +Response: + --- ### Add Queue Tracks Adds tracks to the queue. Response is the next queue track. -``` +```http POST /sessions/{sessionId}/players/{guildId}/queue/tracks ``` +Response: + --- ### Update Queue Tracks Overrides the existing tracks in the queue. Response is the next queue track. -``` +```http PUT /sessions/{sessionId}/players/{guildId}/queue/tracks ``` +Response: + --- ### Delete Queue -``` +```http DELETE /sessions/{sessionId}/players/{guildId}/tracks/queue ``` +Response: + --- ### Get Queue Track Gets a track from the queue at the specified index. Response is a track object. -``` +```http GET /sessions/{sessionId}/players/{guildId}/queue/tracks/{index} ``` +Response: + --- ### Add Queue Track Adds a track at the specified index. Reuqest body is an update player track. -``` +```http PUT /sessions/{sessionId}/players/{guildId}/queue/tracks/{index} ``` +Response: + --- ### Delete Queue Track(s) Deletes a track from the queue. If amount is provided, the specified number of elements after the index will be removed. -``` +```http DELETE /sessions/{sessionId}/players/{guildId}/queue/{index}?amount=0 ``` +Response: + --- ### Move Queue Track Move a track to a different position. This does *not* remove the track at the original index. -``` +```http POST /sessions/{sessionId}/players/{guildId}/queue/{index}/move?position=0 ``` +Response: + --- ### Get Queue History Gets the history of this queue. Response is an array of track objects. -``` +```http GET /sessions/{sessionId}/players/{guildId}/history ``` +Response: + --- ### Get Queue History Track Gets a track from the history at the specified index. Response is a track object. -``` +```http GET /sessions/{sessionId}/players/{guildId}/history/{index} ``` +Response: + --- ## Events From b15c71577eb4647b3c0e24d690661d8929beae1b Mon Sep 17 00:00:00 2001 From: Droid Date: Mon, 3 Feb 2025 16:09:08 -0500 Subject: [PATCH 17/41] Document Return Types --- README.md | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index d89bde1..a3dce70 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ A simple queue plugin for [Lavalink](https://github.com/lavalink-devs/Lavalink) * [Installation](#installation) * [API](#api) * [Get Queue](#get-queue) - * [Update Queue](#update-queue) + * [Modify Queue](#modify-queue) * [Next Queue Track](#next-queue-track) * [Previous Queue Track](#previous-queue-track) * [Add Queue Track](#add-queue-tracks) @@ -113,10 +113,12 @@ The plugin provides a REST API to add, remove, and update tracks in the queue. GET /sessions/{sessionId}/players/{guildId}/queue ``` -Response: [Queue Object](#queue-object) +**Response:** [Queue Object](#queue-object) --- +### Modify Queue + > [!NOTE] > All fields are optional and only the fields you provide will be updated. @@ -126,55 +128,55 @@ Modifies the queue. Overrides the existing tracks if the tracks key is present. PATCH /sessions/{sessionId}/players/{playerId}/queue ``` -Response: +**Response:** [Track Object](https://lavalink.dev/api/rest.html#track) or `204 NO CONTENT` --- ### Next Queue Track -Gets the next track in the queue. Plays the next track if the player isn't playing. Response is a track object. +Gets the next track in the queue. Plays the next track if the player isn't playing. ```http POST /sessions/{sessionId}/players/{guildId}/queue/next ``` -Response: +**Response:** [Track Object](https://lavalink.dev/api/rest.html#track) --- ### Previous Queue Track -Gets the previously playing track. Plays the previous track if the player isn't playing. Response is a track object. +Gets the previously playing track. Plays the previous track if the player isn't playing. ```http POST /sessions/{sessionId}/players/{guildId}/queue/previous ``` -Response: +**Response:** [Track Object](https://lavalink.dev/api/rest.html#track) --- ### Add Queue Tracks -Adds tracks to the queue. Response is the next queue track. +Adds tracks to the queue. ```http POST /sessions/{sessionId}/players/{guildId}/queue/tracks ``` -Response: +**Response:** [Next Track](https://lavalink.dev/api/rest.html#track) --- ### Update Queue Tracks -Overrides the existing tracks in the queue. Response is the next queue track. +Overrides the existing tracks in the queue. ```http PUT /sessions/{sessionId}/players/{guildId}/queue/tracks ``` -Response: +**Response:** [Next Track](https://lavalink.dev/api/rest.html#track) --- @@ -184,43 +186,43 @@ Response: DELETE /sessions/{sessionId}/players/{guildId}/tracks/queue ``` -Response: +**Response:** `204 NO CONTENT` --- ### Get Queue Track -Gets a track from the queue at the specified index. Response is a track object. +Gets a track from the queue at the specified index. ```http GET /sessions/{sessionId}/players/{guildId}/queue/tracks/{index} ``` -Response: +**Response:** [Track Object](https://lavalink.dev/api/rest.html#track) --- ### Add Queue Track -Adds a track at the specified index. Reuqest body is an update player track. +Adds a track at the specified index. Reuqest body is an [update player track](https://lavalink.dev/api/rest#update-player-track). ```http PUT /sessions/{sessionId}/players/{guildId}/queue/tracks/{index} ``` -Response: +**Response:** `204 NO CONTENT` --- ### Delete Queue Track(s) -Deletes a track from the queue. If amount is provided, the specified number of elements after the index will be removed. +Remove a track from the queue. If amount is provided, the specified number of elements after the index will be removed. ```http DELETE /sessions/{sessionId}/players/{guildId}/queue/{index}?amount=0 ``` -Response: +**Response:** `204 NO CONTENT` --- @@ -232,31 +234,31 @@ Move a track to a different position. This does *not* remove the track at the or POST /sessions/{sessionId}/players/{guildId}/queue/{index}/move?position=0 ``` -Response: +**Response:** `204 NO CONTENT` --- ### Get Queue History -Gets the history of this queue. Response is an array of track objects. +Gets the history of this queue. ```http GET /sessions/{sessionId}/players/{guildId}/history ``` -Response: +**Response:** Array of [track](https://lavalink.dev/api/rest.html#track) objects. --- ### Get Queue History Track -Gets a track from the history at the specified index. Response is a track object. +Gets a track from the history at the specified index. ```http GET /sessions/{sessionId}/players/{guildId}/history/{index} ``` -Response: +**Response:** [Track Object](https://lavalink.dev/api/rest.html#track) --- From be53b5ae3c0a02f766f376bd84bac4b524357f86 Mon Sep 17 00:00:00 2001 From: Droid Date: Mon, 3 Feb 2025 16:12:37 -0500 Subject: [PATCH 18/41] Clarify Request Body --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a3dce70..0139262 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,8 @@ Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the The plugin provides a REST API to add, remove, and update tracks in the queue. +--- + ### Get Queue ```http @@ -158,7 +160,7 @@ POST /sessions/{sessionId}/players/{guildId}/queue/previous ### Add Queue Tracks -Adds tracks to the queue. +Adds tracks to the queue. Request body is an [update queue](#common-types) payload. ```http POST /sessions/{sessionId}/players/{guildId}/queue/tracks @@ -170,7 +172,7 @@ POST /sessions/{sessionId}/players/{guildId}/queue/tracks ### Update Queue Tracks -Overrides the existing tracks in the queue. +Overrides the existing tracks in the queue. Request body is an [update queue](#common-types) payload. ```http PUT /sessions/{sessionId}/players/{guildId}/queue/tracks From de4eb305b25847264a5f19432a531df120e84edf Mon Sep 17 00:00:00 2001 From: Droid Date: Mon, 3 Feb 2025 16:14:27 -0500 Subject: [PATCH 19/41] Remove Divider --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 0139262..1147688 100644 --- a/README.md +++ b/README.md @@ -107,8 +107,6 @@ Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the The plugin provides a REST API to add, remove, and update tracks in the queue. ---- - ### Get Queue ```http From 0ea7884c901c0bdabd1e4c0d21d6eb56b95ffca2 Mon Sep 17 00:00:00 2001 From: Droid Date: Mon, 3 Feb 2025 16:18:29 -0500 Subject: [PATCH 20/41] Remove unnessecary backticks --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1147688..9077cdf 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the | Type | Description | |---------------------------------------------------|-----------------------------------------------------------------------------------------------| | [track](https://lavalink.dev/api/rest.html#track) | A track object returned in API responses. | -| `update_queue` | An array of [update player track](https://lavalink.dev/api/rest#update-player-track) objects. | +| update_queue | An array of [update player track](https://lavalink.dev/api/rest#update-player-track) objects. |
Update Queue Payload From 880b14e341b62fab2485d927c62546e7c1d93b2a Mon Sep 17 00:00:00 2001 From: Droid Date: Mon, 3 Feb 2025 16:24:04 -0500 Subject: [PATCH 21/41] move API above types --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9077cdf..752506f 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,10 @@ Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the --- +## API + +The plugin provides a REST API to add, remove, and update tracks in the queue. + ### Queue Modes | Type | Description | @@ -103,10 +107,6 @@ Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the --- -## API - -The plugin provides a REST API to add, remove, and update tracks in the queue. - ### Get Queue ```http From 0b4f4275118807013c2af6dffc65dbd57f2cf6ef Mon Sep 17 00:00:00 2001 From: Droid Date: Mon, 3 Feb 2025 16:27:12 -0500 Subject: [PATCH 22/41] remove divider --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 752506f..3b82db3 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,6 @@ lavalink: Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the short commit hash as the version. ---- - ## API The plugin provides a REST API to add, remove, and update tracks in the queue. From 92e0cb4b327b15e9fc3a7239ce92602b59cf7dc0 Mon Sep 17 00:00:00 2001 From: Droid Date: Mon, 3 Feb 2025 17:09:07 -0500 Subject: [PATCH 23/41] Remove JSON5 and fix types column --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3b82db3..a9caa4d 100644 --- a/README.md +++ b/README.md @@ -57,13 +57,13 @@ The plugin provides a REST API to add, remove, and update tracks in the queue. | Field | Type | Description | |----------------------|--------------------------------------------------------------------|-----------------------------------------| -| [mode](#queue-modes) | string | The mode of the queue. | +| mode | [string](#queue-modes) | The mode of the queue. | | tracks | array of [Track](https://lavalink.dev/api/rest.html#track) objects | An array of track objects in the queue. |
Example Payload -```json5 +```json { "type": "normal", "tracks": [ @@ -86,12 +86,12 @@ The plugin provides a REST API to add, remove, and update tracks in the queue. | Type | Description | |---------------------------------------------------|-----------------------------------------------------------------------------------------------| | [track](https://lavalink.dev/api/rest.html#track) | A track object returned in API responses. | -| update_queue | An array of [update player track](https://lavalink.dev/api/rest#update-player-track) objects. | +| update_queue | An array of [update player track](https://lavalink.dev/api/rest#update-player-track) objects. |
Update Queue Payload -```json5 +```json { [ { @@ -269,7 +269,7 @@ Fires when a queue has ended.
Example Payload -```json5 +```json { "op": "event", "type": "QueueEndEvent", From 80e45e59808eda5b440958523da668001883a6c9 Mon Sep 17 00:00:00 2001 From: Droid Date: Mon, 3 Feb 2025 17:13:57 -0500 Subject: [PATCH 24/41] restructure table --- README.md | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a9caa4d..ca03b38 100644 --- a/README.md +++ b/README.md @@ -9,18 +9,20 @@ A simple queue plugin for [Lavalink](https://github.com/lavalink-devs/Lavalink) * [Installation](#installation) * [API](#api) - * [Get Queue](#get-queue) - * [Modify Queue](#modify-queue) - * [Next Queue Track](#next-queue-track) - * [Previous Queue Track](#previous-queue-track) - * [Add Queue Track](#add-queue-tracks) - * [Update Queue Track](#update-queue-tracks) - * [Get Queue Track](#get-queue-track) - * [Add Queue Track](#add-queue-track) - * [Delete Queue Track(s)](#delete-queue-track(s)) - * [Move Queue Track](#move-queue-track) - * [Get Queue History](#get-queue-history) - * [Get Queue History Track](#get-queue-history-track) + * [Common Types](#common-types) + * [Endpoints](#endpoints) + * [Get Queue](#get-queue) + * [Modify Queue](#modify-queue) + * [Next Queue Track](#next-queue-track) + * [Previous Queue Track](#previous-queue-track) + * [Add Queue Track](#add-queue-tracks) + * [Update Queue Track](#update-queue-tracks) + * [Get Queue Track](#get-queue-track) + * [Add Queue Track](#add-queue-track) + * [Delete Queue Track(s)](#delete-queue-track(s)) + * [Move Queue Track](#move-queue-track) + * [Get Queue History](#get-queue-history) + * [Get Queue History Track](#get-queue-history-track) * [Events](#events) * [QueueEndEvent](#queueendevent) @@ -105,6 +107,8 @@ The plugin provides a REST API to add, remove, and update tracks in the queue. --- +## Endpoints + ### Get Queue ```http From 8df0af2190d8944a413a9cb96c1abee347873d0d Mon Sep 17 00:00:00 2001 From: Droid Date: Sat, 29 Mar 2025 21:50:24 -0400 Subject: [PATCH 25/41] try and improve documentation as-per feedback --- README.md | 132 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 112 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index ca03b38..952fa4c 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,16 @@ The plugin provides a REST API to add, remove, and update tracks in the queue. GET /sessions/{sessionId}/players/{guildId}/queue ``` -**Response:** [Queue Object](#queue-object) +Response: + +200 OK: +- [Queue Object](#queue-object) + +404 Not Found: +- If the provided session is invalid. + +500 Internal Server Error: +- If the provided guild ID is invalid. --- @@ -130,31 +139,61 @@ Modifies the queue. Overrides the existing tracks if the tracks key is present. PATCH /sessions/{sessionId}/players/{playerId}/queue ``` -**Response:** [Track Object](https://lavalink.dev/api/rest.html#track) or `204 NO CONTENT` +Response: + +200 OK: +- The next [Track Object](https://lavalink.dev/api/rest.html#track) in the queue. + +204 No Content: +- The queue was successfully updated, but there isn't a next track to return. --- ### Next Queue Track -Gets the next track in the queue. Plays the next track if the player isn't playing. +Play the next track in the queue. ```http POST /sessions/{sessionId}/players/{guildId}/queue/next ``` -**Response:** [Track Object](https://lavalink.dev/api/rest.html#track) +Query Params: + +| Field | Type | Description | +|--------|---------|---------------------------------------------------| +| count? | integer | How many tracks to skip ahead to. Defaults to one | + +Response: + +200 OK: +- The [Track](https://lavalink.dev/api/rest.html#track) that was skipped to. + +404 Not Found: +- If the track to skip to doesn't exist in the queue. --- ### Previous Queue Track -Gets the previously playing track. Plays the previous track if the player isn't playing. +Play the previously playing track. ```http POST /sessions/{sessionId}/players/{guildId}/queue/previous ``` -**Response:** [Track Object](https://lavalink.dev/api/rest.html#track) +Query Params: + +| Field | Type | Description | +|--------|---------|---------------------------------------------------| +| count? | integer | How many tracks to skip back to. Defaults to one | + +Response: + +200 OK: +- The [Track](https://lavalink.dev/api/rest.html#track) that was skipped to. + +404 Not Found: +- If the track to skip to doesn't exist in the queue. --- @@ -166,7 +205,13 @@ Adds tracks to the queue. Request body is an [update queue](#common-types) paylo POST /sessions/{sessionId}/players/{guildId}/queue/tracks ``` -**Response:** [Next Track](https://lavalink.dev/api/rest.html#track) +Response: + +200 OK: +- The next [Track](https://lavalink.dev/api/rest.html#track) in the queue. + +204 No Content: +- The queue was successfully updated, but the player is either playing a track, or there are no tracks in the queue. --- @@ -178,17 +223,28 @@ Overrides the existing tracks in the queue. Request body is an [update queue](#c PUT /sessions/{sessionId}/players/{guildId}/queue/tracks ``` -**Response:** [Next Track](https://lavalink.dev/api/rest.html#track) +Response: + +200 OK: +- The next [Track](https://lavalink.dev/api/rest.html#track) in the queue. + +204 No Content: +- The queue was successfully updated, but there are no tracks in the queue. --- ### Delete Queue +Clear all the tracks in the queue. + ```http -DELETE /sessions/{sessionId}/players/{guildId}/tracks/queue +DELETE /sessions/{sessionId}/players/{guildId}/queue ``` -**Response:** `204 NO CONTENT` +Response: + +204 No Content: +- The queue was successfully cleared. --- @@ -200,19 +256,28 @@ Gets a track from the queue at the specified index. GET /sessions/{sessionId}/players/{guildId}/queue/tracks/{index} ``` -**Response:** [Track Object](https://lavalink.dev/api/rest.html#track) +Response: + +200 OK: +- The [Track](https://lavalink.dev/api/rest.html#track) at the specifed index. + +404 Not Found: +- A [Track](https://lavalink.dev/api/rest.html#track) couldn't be found at the specified index. --- ### Add Queue Track -Adds a track at the specified index. Reuqest body is an [update player track](https://lavalink.dev/api/rest#update-player-track). +Adds a track at the specified index. Request body is an [update player track](https://lavalink.dev/api/rest#update-player-track). ```http PUT /sessions/{sessionId}/players/{guildId}/queue/tracks/{index} ``` -**Response:** `204 NO CONTENT` +Response: + +200 OK: +- The track was successfully added at the specified index. --- @@ -221,22 +286,43 @@ PUT /sessions/{sessionId}/players/{guildId}/queue/tracks/{index} Remove a track from the queue. If amount is provided, the specified number of elements after the index will be removed. ```http -DELETE /sessions/{sessionId}/players/{guildId}/queue/{index}?amount=0 +DELETE /sessions/{sessionId}/players/{guildId}/queue/{index} ``` -**Response:** `204 NO CONTENT` +Query Params: + +| Field | Type | Description | +|---------|---------|-------------------------------------------| +| amount? | integer | How many tracks to remove after the index | + +Response: + +200 OK: +- The tracks were successfully removed. --- ### Move Queue Track -Move a track to a different position. This does *not* remove the track at the original index. +Move a track to a different position. This does **not** remove the track at the original index. ```http -POST /sessions/{sessionId}/players/{guildId}/queue/{index}/move?position=0 +POST /sessions/{sessionId}/players/{guildId}/queue/{index}/move ``` -**Response:** `204 NO CONTENT` +Query Params: + +| Field | Type | Description | +|----------|---------|----------------------------| +| position | integer | The new index of the track | + +Response: + +200 OK: +- The track was successfully moved. + +404 Not Found: +- A track could not be found at the original index. --- @@ -248,7 +334,10 @@ Gets the history of this queue. GET /sessions/{sessionId}/players/{guildId}/history ``` -**Response:** Array of [track](https://lavalink.dev/api/rest.html#track) objects. +Response: + +200 OK: + Array of [track](https://lavalink.dev/api/rest.html#track) objects from the queue's history. --- @@ -260,7 +349,10 @@ Gets a track from the history at the specified index. GET /sessions/{sessionId}/players/{guildId}/history/{index} ``` -**Response:** [Track Object](https://lavalink.dev/api/rest.html#track) +Response: + +200 OK: +- The [Track](https://lavalink.dev/api/rest.html#track) at the specified index. --- From a326b0aba59164f8e0a3716d24f4709e47172140 Mon Sep 17 00:00:00 2001 From: Droid Date: Sat, 29 Mar 2025 21:51:22 -0400 Subject: [PATCH 26/41] fix minor typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 952fa4c..5e4aad1 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ PATCH /sessions/{sessionId}/players/{playerId}/queue Response: 200 OK: -- The next [Track Object](https://lavalink.dev/api/rest.html#track) in the queue. +- The next [Track](https://lavalink.dev/api/rest.html#track) in the queue. 204 No Content: - The queue was successfully updated, but there isn't a next track to return. From ef3eb41afdf71b9ff8b587a17b93b015d3fa1b3d Mon Sep 17 00:00:00 2001 From: Droid Date: Sat, 29 Mar 2025 21:52:22 -0400 Subject: [PATCH 27/41] fix punctuation --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5e4aad1..3b4c904 100644 --- a/README.md +++ b/README.md @@ -159,9 +159,9 @@ POST /sessions/{sessionId}/players/{guildId}/queue/next Query Params: -| Field | Type | Description | -|--------|---------|---------------------------------------------------| -| count? | integer | How many tracks to skip ahead to. Defaults to one | +| Field | Type | Description | +|--------|---------|----------------------------------------------------| +| count? | integer | How many tracks to skip ahead to. Defaults to one. | Response: @@ -185,7 +185,7 @@ Query Params: | Field | Type | Description | |--------|---------|---------------------------------------------------| -| count? | integer | How many tracks to skip back to. Defaults to one | +| count? | integer | How many tracks to skip back to. Defaults to one. | Response: @@ -293,7 +293,7 @@ Query Params: | Field | Type | Description | |---------|---------|-------------------------------------------| -| amount? | integer | How many tracks to remove after the index | +| amount? | integer | How many tracks to remove after the index.| Response: @@ -314,7 +314,7 @@ Query Params: | Field | Type | Description | |----------|---------|----------------------------| -| position | integer | The new index of the track | +| position | integer | The new index of the track.| Response: From b49e7bc21410730dea85f1528bbdc9a420af805a Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 30 Mar 2025 22:18:31 -0400 Subject: [PATCH 28/41] Remove common types table. --- README.md | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 3b4c904..de9e79c 100644 --- a/README.md +++ b/README.md @@ -83,30 +83,6 @@ The plugin provides a REST API to add, remove, and update tracks in the queue. --- -### Common Types - -| Type | Description | -|---------------------------------------------------|-----------------------------------------------------------------------------------------------| -| [track](https://lavalink.dev/api/rest.html#track) | A track object returned in API responses. | -| update_queue | An array of [update player track](https://lavalink.dev/api/rest#update-player-track) objects. | - -
-Update Queue Payload - -```json -{ - [ - { - "encoded": "QAAAjQIAJVJpY2sgQXN0bGV5IC0gTmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXAADlJpY2tBc3RsZXlWRVZPAAAAAAADPCAAC2RRd" - } - ] -} -``` - -
- ---- - ## Endpoints ### Get Queue @@ -135,6 +111,21 @@ Response: Modifies the queue. Overrides the existing tracks if the tracks key is present. Request body is a [queue object](#queue-object). +
+Example Payload + +```json +{ + "mode": "repeat_track", + "tracks": [ + { + "encoded": "QAAAjQIAJVJpY2sgQXN0bGV5IC0gTmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXAADlJpY2tBc3RsZXlWRVZPAAAAAAADPCAAC2RRd" + } + ] +} +``` +
+ ```http PATCH /sessions/{sessionId}/players/{playerId}/queue ``` @@ -217,7 +208,7 @@ Response: ### Update Queue Tracks -Overrides the existing tracks in the queue. Request body is an [update queue](#common-types) payload. +Overrides the existing tracks in the queue. Request body is an array [update player tracks](https://lavalink.dev/api/rest#update-player-track). ```http PUT /sessions/{sessionId}/players/{guildId}/queue/tracks From 7cf39580934a9a7d29c9e81217d43d9101ad6ce5 Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 30 Mar 2025 22:20:31 -0400 Subject: [PATCH 29/41] Fix capitalization. --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index de9e79c..04bc105 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ The plugin provides a REST API to add, remove, and update tracks in the queue. | Field | Type | Description | |----------------------|--------------------------------------------------------------------|-----------------------------------------| | mode | [string](#queue-modes) | The mode of the queue. | -| tracks | array of [Track](https://lavalink.dev/api/rest.html#track) objects | An array of track objects in the queue. | +| tracks | array of [track](https://lavalink.dev/api/rest.html#track) objects | An array of track objects in the queue. |
Example Payload @@ -133,7 +133,7 @@ PATCH /sessions/{sessionId}/players/{playerId}/queue Response: 200 OK: -- The next [Track](https://lavalink.dev/api/rest.html#track) in the queue. +- The next [track](https://lavalink.dev/api/rest.html#track) in the queue. 204 No Content: - The queue was successfully updated, but there isn't a next track to return. @@ -157,7 +157,7 @@ Query Params: Response: 200 OK: -- The [Track](https://lavalink.dev/api/rest.html#track) that was skipped to. +- The [track](https://lavalink.dev/api/rest.html#track) that was skipped to. 404 Not Found: - If the track to skip to doesn't exist in the queue. @@ -181,7 +181,7 @@ Query Params: Response: 200 OK: -- The [Track](https://lavalink.dev/api/rest.html#track) that was skipped to. +- The [track](https://lavalink.dev/api/rest.html#track) that was skipped to. 404 Not Found: - If the track to skip to doesn't exist in the queue. @@ -199,7 +199,7 @@ POST /sessions/{sessionId}/players/{guildId}/queue/tracks Response: 200 OK: -- The next [Track](https://lavalink.dev/api/rest.html#track) in the queue. +- The next [track](https://lavalink.dev/api/rest.html#track) in the queue. 204 No Content: - The queue was successfully updated, but the player is either playing a track, or there are no tracks in the queue. @@ -217,7 +217,7 @@ PUT /sessions/{sessionId}/players/{guildId}/queue/tracks Response: 200 OK: -- The next [Track](https://lavalink.dev/api/rest.html#track) in the queue. +- The next [track](https://lavalink.dev/api/rest.html#track) in the queue. 204 No Content: - The queue was successfully updated, but there are no tracks in the queue. @@ -250,10 +250,10 @@ GET /sessions/{sessionId}/players/{guildId}/queue/tracks/{index} Response: 200 OK: -- The [Track](https://lavalink.dev/api/rest.html#track) at the specifed index. +- The [track](https://lavalink.dev/api/rest.html#track) at the specifed index. 404 Not Found: -- A [Track](https://lavalink.dev/api/rest.html#track) couldn't be found at the specified index. +- A [track](https://lavalink.dev/api/rest.html#track) couldn't be found at the specified index. --- @@ -343,7 +343,7 @@ GET /sessions/{sessionId}/players/{guildId}/history/{index} Response: 200 OK: -- The [Track](https://lavalink.dev/api/rest.html#track) at the specified index. +- The [track](https://lavalink.dev/api/rest.html#track) at the specified index. --- From 97726646bcaa09e2951b119e1873b0ce9003c623 Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 30 Mar 2025 22:28:49 -0400 Subject: [PATCH 30/41] Experiment with headings --- README.md | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 04bc105..d611fcc 100644 --- a/README.md +++ b/README.md @@ -11,18 +11,21 @@ A simple queue plugin for [Lavalink](https://github.com/lavalink-devs/Lavalink) * [API](#api) * [Common Types](#common-types) * [Endpoints](#endpoints) - * [Get Queue](#get-queue) - * [Modify Queue](#modify-queue) - * [Next Queue Track](#next-queue-track) - * [Previous Queue Track](#previous-queue-track) - * [Add Queue Track](#add-queue-tracks) - * [Update Queue Track](#update-queue-tracks) - * [Get Queue Track](#get-queue-track) - * [Add Queue Track](#add-queue-track) - * [Delete Queue Track(s)](#delete-queue-track(s)) - * [Move Queue Track](#move-queue-track) - * [Get Queue History](#get-queue-history) - * [Get Queue History Track](#get-queue-history-track) + * [Queue]() + * [Get Queue](#get-queue) + * [Modify Queue](#modify-queue) + * [Queue Tracks]() + * [Next Queue Track](#next-queue-track) + * [Previous Queue Track](#previous-queue-track) + * [Add Queue Track](#add-queue-tracks) + * [Update Queue Track](#update-queue-tracks) + * [Get Queue Track](#get-queue-track) + * [Add Queue Track](#add-queue-track) + * [Delete Queue Track(s)](#delete-queue-track(s)) + * [Move Queue Track](#move-queue-track) + * [Queue History]() + * [Get Queue History](#get-queue-history) + * [Get Queue History Track](#get-queue-history-track) * [Events](#events) * [QueueEndEvent](#queueendevent) @@ -85,6 +88,27 @@ The plugin provides a REST API to add, remove, and update tracks in the queue. ## Endpoints +### Summary + + +* [Queue]() + * [Get Queue](#get-queue) + * [Modify Queue](#modify-queue) +* [Queue Tracks]() + * [Next Queue Track](#next-queue-track) + * [Previous Queue Track](#previous-queue-track) + * [Add Queue Track](#add-queue-tracks) + * [Update Queue Track](#update-queue-tracks) + * [Get Queue Track](#get-queue-track) + * [Add Queue Track](#add-queue-track) + * [Delete Queue Track(s)](#delete-queue-track(s)) + * [Move Queue Track](#move-queue-track) +* [Queue History]() + * [Get Queue History](#get-queue-history) + * [Get Queue History Track](#get-queue-history-track) +* [Events](#events) + * [QueueEndEvent](#queueendevent) + ### Get Queue ```http From 1669b8afb4813d2c706ceeab0cd4a42a3576eef3 Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 30 Mar 2025 22:31:28 -0400 Subject: [PATCH 31/41] Try adding in headings --- README.md | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index d611fcc..663e001 100644 --- a/README.md +++ b/README.md @@ -88,26 +88,7 @@ The plugin provides a REST API to add, remove, and update tracks in the queue. ## Endpoints -### Summary - - -* [Queue]() - * [Get Queue](#get-queue) - * [Modify Queue](#modify-queue) -* [Queue Tracks]() - * [Next Queue Track](#next-queue-track) - * [Previous Queue Track](#previous-queue-track) - * [Add Queue Track](#add-queue-tracks) - * [Update Queue Track](#update-queue-tracks) - * [Get Queue Track](#get-queue-track) - * [Add Queue Track](#add-queue-track) - * [Delete Queue Track(s)](#delete-queue-track(s)) - * [Move Queue Track](#move-queue-track) -* [Queue History]() - * [Get Queue History](#get-queue-history) - * [Get Queue History Track](#get-queue-history-track) -* [Events](#events) - * [QueueEndEvent](#queueendevent) +## Queue ### Get Queue @@ -164,6 +145,8 @@ Response: --- +## Queue Tracks + ### Next Queue Track Play the next track in the queue. @@ -341,6 +324,8 @@ Response: --- +## Queue History + ### Get Queue History Gets the history of this queue. From 37ebb8e52d29016f143849cde6cede1763e40230 Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 30 Mar 2025 22:32:48 -0400 Subject: [PATCH 32/41] Fix formatting --- README.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 663e001..98d64dd 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,10 @@ A simple queue plugin for [Lavalink](https://github.com/lavalink-devs/Lavalink) * [API](#api) * [Common Types](#common-types) * [Endpoints](#endpoints) - * [Queue]() + * [Queue](#queue) * [Get Queue](#get-queue) * [Modify Queue](#modify-queue) - * [Queue Tracks]() + * [Queue Tracks](#queue-tracks) * [Next Queue Track](#next-queue-track) * [Previous Queue Track](#previous-queue-track) * [Add Queue Track](#add-queue-tracks) @@ -23,7 +23,7 @@ A simple queue plugin for [Lavalink](https://github.com/lavalink-devs/Lavalink) * [Add Queue Track](#add-queue-track) * [Delete Queue Track(s)](#delete-queue-track(s)) * [Move Queue Track](#move-queue-track) - * [Queue History]() + * [Queue History](#queue-history) * [Get Queue History](#get-queue-history) * [Get Queue History Track](#get-queue-history-track) * [Events](#events) @@ -143,8 +143,6 @@ Response: 204 No Content: - The queue was successfully updated, but there isn't a next track to return. ---- - ## Queue Tracks ### Next Queue Track @@ -322,8 +320,6 @@ Response: 404 Not Found: - A track could not be found at the original index. ---- - ## Queue History ### Get Queue History From a8d4e13202603d39b47a76d9f5d6d091cadbbbc8 Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 30 Mar 2025 22:33:50 -0400 Subject: [PATCH 33/41] Remove needless divider --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 98d64dd..aa4f363 100644 --- a/README.md +++ b/README.md @@ -350,8 +350,6 @@ Response: 200 OK: - The [track](https://lavalink.dev/api/rest.html#track) at the specified index. ---- - ## Events ### QueueEndEvent From d787e82f7b36b8f6ef3d07b7553c34549d3e4259 Mon Sep 17 00:00:00 2001 From: Droid Date: Sun, 30 Mar 2025 22:34:59 -0400 Subject: [PATCH 34/41] Remove endpoints heading. --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index aa4f363..a832282 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ A simple queue plugin for [Lavalink](https://github.com/lavalink-devs/Lavalink) * [API](#api) * [Common Types](#common-types) * [Endpoints](#endpoints) - * [Queue](#queue) + * [Queue](#endpoints) * [Get Queue](#get-queue) * [Modify Queue](#modify-queue) * [Queue Tracks](#queue-tracks) @@ -88,8 +88,6 @@ The plugin provides a REST API to add, remove, and update tracks in the queue. ## Endpoints -## Queue - ### Get Queue ```http From d0d38583302a3559658a358c5d529c74ab1ccfba Mon Sep 17 00:00:00 2001 From: Droid Date: Fri, 4 Apr 2025 17:01:00 -0400 Subject: [PATCH 35/41] Apply suggestions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Toπ --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a832282..1a734cc 100644 --- a/README.md +++ b/README.md @@ -275,7 +275,7 @@ Response: --- -### Delete Queue Track(s) +### Delete Queue Tracks Remove a track from the queue. If amount is provided, the specified number of elements after the index will be removed. @@ -331,7 +331,7 @@ GET /sessions/{sessionId}/players/{guildId}/history Response: 200 OK: - Array of [track](https://lavalink.dev/api/rest.html#track) objects from the queue's history. + Array of [track](https://lavalink.dev/api/rest.html#track) objects --- From 58936e71bd8e5092ce8f963170c3cdc1371dc554 Mon Sep 17 00:00:00 2001 From: Droid Date: Fri, 4 Apr 2025 17:12:51 -0400 Subject: [PATCH 36/41] Partially make requested changes. --- README.md | 74 ++++++++++++++++++++++++------------------------------- 1 file changed, 32 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 1a734cc..43bdaa3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # LavaQueue > [!IMPORTANT] -> This plugin *requires* Lavalink `v4.0.5` or greater +> This plugin *requires* Lavalink `v4.0.6` or greater A simple queue plugin for [Lavalink](https://github.com/lavalink-devs/Lavalink) with a REST API. @@ -20,8 +20,8 @@ A simple queue plugin for [Lavalink](https://github.com/lavalink-devs/Lavalink) * [Add Queue Track](#add-queue-tracks) * [Update Queue Track](#update-queue-tracks) * [Get Queue Track](#get-queue-track) - * [Add Queue Track](#add-queue-track) - * [Delete Queue Track(s)](#delete-queue-track(s)) + * [Set Queue Track](#set-queue-track) + * [Delete Queue Tracks](#delete-queue-tracks) * [Move Queue Track](#move-queue-track) * [Queue History](#queue-history) * [Get Queue History](#get-queue-history) @@ -47,8 +47,11 @@ Snapshot builds are available at https://maven.lavalink.dev/#/snapshots with the ## API The plugin provides a REST API to add, remove, and update tracks in the queue. +Fields marked with `?` are optional and types marked with `?` are nullable. -### Queue Modes +### Common Types + +#### Queue Modes | Type | Description | |-----------------|----------------------------------------------------| @@ -58,7 +61,7 @@ The plugin provides a REST API to add, remove, and update tracks in the queue. --- -### Queue Object +#### Queue Object | Field | Type | Description | |----------------------|--------------------------------------------------------------------|-----------------------------------------| @@ -84,11 +87,9 @@ The plugin provides a REST API to add, remove, and update tracks in the queue.
---- - -## Endpoints +### Endpoints -### Get Queue +#### Get Queue ```http GET /sessions/{sessionId}/players/{guildId}/queue @@ -99,15 +100,9 @@ Response: 200 OK: - [Queue Object](#queue-object) -404 Not Found: -- If the provided session is invalid. - -500 Internal Server Error: -- If the provided guild ID is invalid. - --- -### Modify Queue +#### Modify Queue > [!NOTE] > All fields are optional and only the fields you provide will be updated. @@ -141,9 +136,9 @@ Response: 204 No Content: - The queue was successfully updated, but there isn't a next track to return. -## Queue Tracks +### Queue Tracks -### Next Queue Track +#### Next Queue Track Play the next track in the queue. @@ -162,12 +157,9 @@ Response: 200 OK: - The [track](https://lavalink.dev/api/rest.html#track) that was skipped to. -404 Not Found: -- If the track to skip to doesn't exist in the queue. - --- -### Previous Queue Track +#### Previous Queue Track Play the previously playing track. @@ -186,12 +178,9 @@ Response: 200 OK: - The [track](https://lavalink.dev/api/rest.html#track) that was skipped to. -404 Not Found: -- If the track to skip to doesn't exist in the queue. - --- -### Add Queue Tracks +#### Add Queue Tracks Adds tracks to the queue. Request body is an [update queue](#common-types) payload. @@ -209,7 +198,7 @@ Response: --- -### Update Queue Tracks +#### Update Queue Tracks Overrides the existing tracks in the queue. Request body is an array [update player tracks](https://lavalink.dev/api/rest#update-player-track). @@ -227,7 +216,7 @@ Response: --- -### Delete Queue +#### Delete Queue Clear all the tracks in the queue. @@ -237,12 +226,12 @@ DELETE /sessions/{sessionId}/players/{guildId}/queue Response: -204 No Content: +200 OK: - The queue was successfully cleared. --- -### Get Queue Track +#### Get Queue Track Gets a track from the queue at the specified index. @@ -255,12 +244,9 @@ Response: 200 OK: - The [track](https://lavalink.dev/api/rest.html#track) at the specifed index. -404 Not Found: -- A [track](https://lavalink.dev/api/rest.html#track) couldn't be found at the specified index. - --- -### Add Queue Track +#### Set Queue Track Adds a track at the specified index. Request body is an [update player track](https://lavalink.dev/api/rest#update-player-track). @@ -275,7 +261,7 @@ Response: --- -### Delete Queue Tracks +#### Delete Queue Tracks Remove a track from the queue. If amount is provided, the specified number of elements after the index will be removed. @@ -296,7 +282,7 @@ Response: --- -### Move Queue Track +#### Move Queue Track Move a track to a different position. This does **not** remove the track at the original index. @@ -315,12 +301,9 @@ Response: 200 OK: - The track was successfully moved. -404 Not Found: -- A track could not be found at the original index. +### Queue History -## Queue History - -### Get Queue History +#### Get Queue History Gets the history of this queue. @@ -335,7 +318,7 @@ Response: --- -### Get Queue History Track +#### Get Queue History Track Gets a track from the history at the specified index. @@ -354,6 +337,13 @@ Response: Fires when a queue has ended. +#### Payload Structure + +| Field | Type | Description | +|----------------------|--------------------------------------------------------------------|----------------------------------------------| +| type | String | The type of event. | +| guildId | String | The ID of the guild the queue has ended for. | +
Example Payload From 991e6f529359a51d8ac7a85dcc21b692497b1375 Mon Sep 17 00:00:00 2001 From: Droid Date: Fri, 4 Apr 2025 17:14:22 -0400 Subject: [PATCH 37/41] Add missing divider --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 43bdaa3..fa1a96a 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,8 @@ Fields marked with `?` are optional and types marked with `?` are nullable.
+--- + ### Endpoints #### Get Queue From c3910c7bdbd24e868c53e1dd882ea850afe9553a Mon Sep 17 00:00:00 2001 From: Droid Date: Fri, 4 Apr 2025 17:16:00 -0400 Subject: [PATCH 38/41] Nest events --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fa1a96a..9b83006 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,8 @@ A simple queue plugin for [Lavalink](https://github.com/lavalink-devs/Lavalink) * [Queue History](#queue-history) * [Get Queue History](#get-queue-history) * [Get Queue History Track](#get-queue-history-track) -* [Events](#events) - * [QueueEndEvent](#queueendevent) + * [Events](#events) + * [QueueEndEvent](#queueendevent) ## Installation @@ -333,13 +333,13 @@ Response: 200 OK: - The [track](https://lavalink.dev/api/rest.html#track) at the specified index. -## Events +### Events -### QueueEndEvent +#### QueueEndEvent Fires when a queue has ended. -#### Payload Structure +##### Payload Structure | Field | Type | Description | |----------------------|--------------------------------------------------------------------|----------------------------------------------| From 000f07fadc9422f95624f122497e3c94f5d6f80e Mon Sep 17 00:00:00 2001 From: Droid Date: Fri, 4 Apr 2025 17:16:42 -0400 Subject: [PATCH 39/41] Add missing divider --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9b83006..c1a442b 100644 --- a/README.md +++ b/README.md @@ -333,6 +333,8 @@ Response: 200 OK: - The [track](https://lavalink.dev/api/rest.html#track) at the specified index. +--- + ### Events #### QueueEndEvent From c82945014a0cb03896cc4f8081be423b851b7bdd Mon Sep 17 00:00:00 2001 From: Droid Date: Fri, 4 Apr 2025 17:22:06 -0400 Subject: [PATCH 40/41] Add missing dividers --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index c1a442b..e62511f 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,8 @@ Response: ### Queue Tracks +--- + #### Next Queue Track Play the next track in the queue. @@ -303,6 +305,8 @@ Response: 200 OK: - The track was successfully moved. +--- + ### Queue History #### Get Queue History From 231ac12e700ad45c1917db5b76927edec7558118 Mon Sep 17 00:00:00 2001 From: Droid Date: Fri, 4 Apr 2025 17:23:11 -0400 Subject: [PATCH 41/41] Format tables --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e62511f..82084d5 100644 --- a/README.md +++ b/README.md @@ -138,10 +138,10 @@ Response: 204 No Content: - The queue was successfully updated, but there isn't a next track to return. -### Queue Tracks - --- +### Queue Tracks + #### Next Queue Track Play the next track in the queue.