From f25ee734a3ef6ad50ec4e1fc8e6ca38a54378cfe Mon Sep 17 00:00:00 2001 From: Hazem Krimi Date: Thu, 7 May 2020 12:41:57 +0100 Subject: [PATCH] removed dotenv and fixed bug in play from youtube search --- .gitignore | 2 +- commands/music/play.js | 2 +- index.js | 2 -- package-lock.json | 5 ----- package.json | 1 - 5 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 3ec544c..1e1baaa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ node_modules/ -.env \ No newline at end of file +nodemon.json \ No newline at end of file diff --git a/commands/music/play.js b/commands/music/play.js index 45ac069..209af29 100644 --- a/commands/music/play.js +++ b/commands/music/play.js @@ -145,7 +145,7 @@ module.exports = class Play extends Command { } } else { const videos = await youtube.searchVideos(query, 1); - if (!videos.length === 1) return message.reply('nothing found!'); + if (videos.length !== 1) return message.reply('nothing found!'); const video = await youtube.getVideoByID(videos[0].raw.id.videoId); diff --git a/index.js b/index.js index 16ea0bb..c207eaf 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,3 @@ -require('dotenv').config(); - const { CommandoClient } = require('discord.js-commando'); const { Structures } = require('discord.js'); const path = require('path'); diff --git a/package-lock.json b/package-lock.json index 958ac26..f6047ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -489,11 +489,6 @@ "require-all": "^3.0.0" } }, - "dotenv": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", - "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==" - }, "end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", diff --git a/package.json b/package.json index 3d4f2a7..02250cd 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "@discordjs/opus": "^0.2.1", "discord.js": "^12.2.0", "discord.js-commando": "github:discordjs/Commando", - "dotenv": "^8.2.0", "puppeteer": "^3.0.2", "simple-youtube-api": "^5.2.1", "sodium": "^3.0.2",