From 3b3cb79c9bd9eb8276297187e9d39d375a6c58b7 Mon Sep 17 00:00:00 2001 From: markokajzer Date: Sun, 13 Nov 2016 12:29:52 +0900 Subject: [PATCH] Fixed a bug, when typing sound that does not exist --- bot.js | 9 +++++---- package.json | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bot.js b/bot.js index cdce00f2..fe23453d 100644 --- a/bot.js +++ b/bot.js @@ -78,12 +78,13 @@ bot.on('message', (message) => { // Add sound to queue if exists const sound = message.content.split('!')[1]; - if (sounds.includes(sound)) + if (sounds.includes(sound)) { addToQueue(voiceChannel, sound); - // Work through queue - if (bot.voiceConnections.array().length === 0) - playSoundQueue(); + // Work through queue + if (bot.voiceConnections.array().length === 0) + playSoundQueue(); + } }); function listCommands(user) { diff --git a/package.json b/package.json index 86c4d5b7..2552fbc5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dicord_soundbot", - "version": "0.3.0", + "version": "0.3.1", "description": "A Discord Bot to play sounds", "main": "bot.js", "dependencies": {