Skip to content

Commit

Permalink
Fixed a bug, when typing sound that does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
markokajzer committed Nov 13, 2016
1 parent e340388 commit 3b3cb79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit 3b3cb79

Please sign in to comment.