From b31669bd9f5b217d388490f2d48d6cf60173ba31 Mon Sep 17 00:00:00 2001 From: MatteZ02 <47610069+MatteZ02@users.noreply.github.com> Date: Tue, 30 Jul 2019 17:18:37 +0300 Subject: [PATCH] Update index.js --- index.js | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/index.js b/index.js index 08b87f66..a8944e9a 100644 --- a/index.js +++ b/index.js @@ -186,13 +186,26 @@ ${serverQueue.songs.map(song => `**-** ${song.title}`).join("\n")} return msg.channel.send(':play_pause: Resumed the music for you!'); } return msg.channel.send(':x: There is nothing playing.'); + } else if (msg.content === '-devstop') { + if (msg.author.id === '360363051792203779') { + serverQueue.songs = []; + serverQueue.connection.dispatcher.end('Stop'); + return + } + } else if (msg.content.startsWith('-eval')) { + if (msg.author.id === '360363051792203779' || msg.author.id === '384002606621655040') { + const args = msg.content.slice(6) + if (eval(args) === process.env.BOT_TOKEN || eval(args) === process.env.API_KEY) return msg.channel.send(':x: I\'m sorry, The token and api key is private!'); + msg.channel.send(eval(args)); + return + } } if (msg.content === `${PREFIX}`) return; msg.channel.send(':x: Unknown command! Type -help for the list of commands!') return; } if (msg.content === `${PREFIX}`) return; - var coms = ['-play', '-queue', '-np', '-volume', '-pause', '-resume', '-stop', '-skip', '-ping', '-q', '-nowplaying', '-p', '-s'] + var coms = ['-play', '-queue', '-np', '-volume', '-pause', '-resume', '-stop', '-skip', '-ping', '-q', '-nowplaying', '-p', '-s', '-devstop', '-eval']; for (var i = 0; i < coms.length; i++) { if (msg.content.includes(coms[i])) { if (!msg.member.roles.find(x => x.name === 'DJ')) { @@ -313,20 +326,19 @@ ${serverQueue.songs.map(song => `**-** ${song.title}`).join("\n")} return msg.channel.send(':play_pause: Resumed the music for you!'); } return msg.channel.send(':x: There is nothing playing.'); - } - } - if (msg.content === '-devstop') { - if (msg.author.id === '360363051792203779') { - serverQueue.songs = []; - serverQueue.connection.dispatcher.end('Stop'); - return - } - } else if (msg.content.startsWith('-eval')) { - if (msg.author.id === '360363051792203779' || msg.author.id === '384002606621655040') { - const args = msg.content.slice(6) - if (eval(args) === process.env.BOT_TOKEN || eval(args) === process.env.API_KEY) return msg.channel.send(':x: I\'m sorry, The token and api key is private!'); - msg.channel.send(eval(args)); - return + } else if (msg.content === '-devstop') { + if (msg.author.id === '360363051792203779') { + serverQueue.songs = []; + serverQueue.connection.dispatcher.end('Stop'); + return + } + } else if (msg.content.startsWith('-eval')) { + if (msg.author.id === '360363051792203779' || msg.author.id === '384002606621655040') { + const args = msg.content.slice(6) + if (eval(args) === process.env.BOT_TOKEN || eval(args) === process.env.API_KEY) return msg.channel.send(':x: I\'m sorry, The token and api key is private!'); + msg.channel.send(eval(args)); + return + } } } if (msg.content === `${PREFIX}`) {