diff --git a/commands/play.js b/commands/play.js index a74019dc..29582d29 100644 --- a/commands/play.js +++ b/commands/play.js @@ -43,10 +43,17 @@ module.exports = { } catch (err) { console.error(err); if (err.code === 403) { - if (client.config.api_key === client.config.api_key2) { - client.config.api_key = client.config.api_key3; - } else { + if (client.config.api_key === client.config.api_key) { + console.log('KEY 2'); client.config.api_key = client.config.api_key2; + } else if (client.config.api_key === client.config.api_key2) { + console.log('KEY 3'); + client.config.api_key = client.config.api_key3; + } else if (client.config.api_key === client.config.api_key3) { + client.config.api_key = client.config.api_key4; + } + else if (client.config.api_key === client.config.api_key4) { + client.config.api_key = client.config.api_key1; } return msg.channel.send(client.messages.quotaReached); } diff --git a/struct/config/config.js b/struct/config/config.js index da1c41ca..c8e7e218 100644 --- a/struct/config/config.js +++ b/struct/config/config.js @@ -5,8 +5,10 @@ module.exports = { devToken: process.env.DEVTOKEN, dblKey: process.env.DBLKEY, api_key: process.env.GOOGLE_API_KEY, + api_key1: process.env.GOOGLE_API_KEY1, api_key2: process.env.GOOGLE_API_KEY2, api_key3: process.env.GOOGLE_API_KEY3, + api_key4: process.env.GOOGLE_API_KEY4, testServer: "489111553321336832", debug_channel: "634718645188034560", primary_test_channel: "617633098296721409",