From 2686829e80b117f1662126d803363e6e6b121c82 Mon Sep 17 00:00:00 2001 From: MatteZ02 <47610069+MatteZ02@users.noreply.github.com> Date: Sun, 12 Jul 2020 19:16:54 +0300 Subject: [PATCH] patched error with keys (temporary) --- src/events/dispatcherEvents/finish.js | 2 +- src/struct/client.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/events/dispatcherEvents/finish.js b/src/events/dispatcherEvents/finish.js index b97d5cb1..f189b363 100644 --- a/src/events/dispatcherEvents/finish.js +++ b/src/events/dispatcherEvents/finish.js @@ -48,7 +48,7 @@ function findSimilar(client, queue, prevSongs, guild) { limit: 10, lastfmAPIKey: client.config.lastfm_api_key, lastfmAPISecret: client.config.lastfm_secret, - youtubeAPIKey: client.config.api_keys[(client.shard.ids / 2).toFixed()], + youtubeAPIKey: client.config.api_keys[(client.shard.ids / 2).toFixed() || client.config.api_key], }, async function (err, songs) { if (err) { diff --git a/src/struct/client.js b/src/struct/client.js index d4b6f1cd..b42d2432 100644 --- a/src/struct/client.js +++ b/src/struct/client.js @@ -38,7 +38,7 @@ module.exports = class extends Client { id: config.spotify_client_id, secret: config.spotify_client_secret, }); - this.youtube = new YouTube(config.api_keys[(this.shard.ids / 2).toFixed()]); + this.youtube = new YouTube(config.api_keys[(this.shard.ids / 2).toFixed()] || client.config.api_key); this.config = config; this.funcs = {}; this.dispatcher = {};