Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use response.json() for parsing JSON #26

Merged
merged 2 commits into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
"name": "sunday.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"version": "1.0.17",
"version": "1.0.18",
"description": "Sunday a lavalink wrapper",
"license": "MIT",
"author": "FAYStarNext",
"scripts": {
"build:js": "npx babel src --out-dir dist --extensions \".ts,.tsx\" --source-maps inline",
"lint": "npx eslint src/**/*.ts",
"test:connect": "bun test/connect.ts",
"test:manager": "bun test/manager.ts",
"test:player": "bun test/player.ts"
},
Expand Down
2 changes: 1 addition & 1 deletion src/structures/Rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class Rest {
},
body: JSON.stringify(body),
});
return JSON.parse(await response.text());
return await response.json();
} catch(error) {
if (error?.response?.status === 404) {
this.node.destroy();
Expand Down
4 changes: 4 additions & 0 deletions test/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ let manager = new Manager({
password: 'youshallnotpass',
},
],
caches: {
enabled: true,
time: 60000,
},
clientId: "1234567890",
send(guild_id, payload) {
const guild = client.guilds.cache.get(guild_id);
Expand Down