aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--absettings.json.example1
-rw-r--r--src/bot_discord.js1
-rw-r--r--src/commands/play.js2
3 files changed, 3 insertions, 1 deletions
diff --git a/absettings.json.example b/absettings.json.example
index e9d4e0b..4894b84 100644
--- a/absettings.json.example
+++ b/absettings.json.example
@@ -2,4 +2,5 @@
"abtoken": "token",
"ownerID": "242775871059001344",
"prefix": "ab:",
+ "ytapikey": "generate one in google apis youtube v3",
}
diff --git a/src/bot_discord.js b/src/bot_discord.js
index d6ade60..3d7a3ee 100644
--- a/src/bot_discord.js
+++ b/src/bot_discord.js
@@ -13,6 +13,7 @@ const fs = require('fs');
const config = require('./absettings.json');
console.log('Welcome to AleeBot NodeJS Terminal!');
+client.apikey = config.ytapikey;
client.commands = new Discord.Collection();
client.aliases = new Discord.Collection();
diff --git a/src/commands/play.js b/src/commands/play.js
index 50911b9..2c7d0dd 100644
--- a/src/commands/play.js
+++ b/src/commands/play.js
@@ -3,7 +3,7 @@ module.exports.run = async (client, message, args) => {
if (!message.member.voiceChannelID) return await message.channel.send('You are not in a voice channel');
const YouTube = require('simple-youtube-api');
const moment = require('moment');
- const youtube = new YouTube(process.env.GOOGLE);
+ const youtube = new YouTube(client.apikey);
const url = args.join(' ').replace(/<(.+)>/g, '$1');
if (!url) return;
await youtube.getVideo(url)