From 2a0d3aab248e821b61d5c50e37802672849e160e Mon Sep 17 00:00:00 2001 From: MatteZ02 <47610069+MatteZ02@users.noreply.github.com> Date: Sun, 16 Jun 2019 16:03:14 +0300 Subject: [PATCH] Update index.js --- index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 34304938..337f6fbd 100644 --- a/index.js +++ b/index.js @@ -87,9 +87,6 @@ client.on('message', async msg => { return undefined; } if (msg.member.guild.roles.find(x => x.name === 'DJ')) { - if (!msg.member.roles.find(x => x.name === 'DJ')) { - msg.channel.send(':x: i\'m sorry but you need to have the \'DJ\' role use music commands!') - } if (msg.member.roles.find(x => x.name === 'DJ')) { const args = msg.content.split(' '); const searchString = args.slice(1).join(' '); @@ -203,6 +200,10 @@ Please provide a value to select one of the search results ranging from __1-10__ msg.channel.send(':x: Unknown command! Type -help for the list of commands!') return undefined; } + if (!msg.member.roles.find(x => x.name === 'DJ')) { + msg.channel.send(':x: i\'m sorry but you need to have the \'DJ\' role use music commands!') + return; + } if (msg.content === `${PREFIX}`) return; msg.channel.send(':x: Unknown command! Type -help for the list of commands!') }