Skip to content

Commit 644802a

Browse files
committed
fix(REST): check for url first
1 parent d90fd7e commit 644802a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"author": {
44
"name": "KagChi"
55
},
6-
"version": "0.1.1",
6+
"version": "0.1.2",
77
"license": "GPL-3.0",
88
"main": "dist/index.js",
99
"module": "dist/index.mjs",

Diff for: src/Structures/REST.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ export class REST {
5757
public loadTracks(options: { source?: LavalinkSource; query: string } | string) {
5858
if (typeof options === 'string') {
5959
return this.get<LoadTrackResponse>(
60-
`loadtracks?identifier=${encodeURIComponent(`${this.resolveIdentifier(LavalinkSourceEnum.Youtube)}:${options}`)}`
60+
`loadtracks?identifier=${
61+
this.isUrl(options)
62+
? encodeURIComponent(options)
63+
: encodeURIComponent(`${this.resolveIdentifier(LavalinkSourceEnum.Youtube)}:${options}`)
64+
}`
6165
);
6266
}
6367
const source = options.source ?? LavalinkSourceEnum.Youtube;

0 commit comments

Comments
 (0)