From bb8f58b3d47ced40ff95ba326628be502342c50e Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Tue, 9 Mar 2021 19:57:48 -0500 Subject: [PATCH] Fix? --- commands/games-sp/guess-song.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/commands/games-sp/guess-song.js b/commands/games-sp/guess-song.js index 236f17c6..3605788d 100644 --- a/commands/games-sp/guess-song.js +++ b/commands/games-sp/guess-song.js @@ -116,8 +116,11 @@ module.exports = class GuessSongCommand extends Command { async fetchToken() { const { body } = await request .post('https://accounts.spotify.com/api/token') - .set({ Authorization: `Basic ${base64(`${SPOTIFY_KEY}:${SPOTIFY_SECRET}`)}` }) - .attach('grant_type', 'client_credentials'); + .set({ + Authorization: `Basic ${base64(`${SPOTIFY_KEY}:${SPOTIFY_SECRET}`)}`, + 'Content-Type': 'application/x-www-form-urlencoded' + }) + .send('grant_type=client_credentials'); this.token = body.access_token; setTimeout(() => { this.token = null; }, body.expires_in); return body;