Skip to content

Commit

Permalink
Update Node.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
memte authored Oct 13, 2024
1 parent d1ee251 commit 7aece23
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/structures/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ export class LavalinkNode {
* player.node.rawRequest(`/loadtracks?identifier=Never gonna give you up`, (options) => options.method = "GET");
* ```
*/
async rawRequest(endpoint, modify) {
const options = {
private async rawRequest(endpoint: string, modify?: ModifyRequest): Promise<{ response: Response, options: RequestInit & { path: string, extraQueryUrlParams?: URLSearchParams } }> {
const options: RequestInit & { path: string, extraQueryUrlParams?: URLSearchParams } = {
path: `/${this.version}/${endpoint.replace(/^\//gm, "")}`,
method: "GET",
headers: {
Expand All @@ -162,7 +162,7 @@ async rawRequest(endpoint, modify) {

const { signal, ...cloneableOptions } = options;
const originalOptions = structuredClone(cloneableOptions);

delete options.path;
delete options.extraQueryUrlParams;

Expand All @@ -171,6 +171,7 @@ async rawRequest(endpoint, modify) {
return { response, options: originalOptions };
}


/**
* Makes an API call to the Node. Should only be used for manual parsing like for not supported plugins
* @param endpoint The endpoint that we will make the call to
Expand Down

0 comments on commit 7aece23

Please sign in to comment.