From e1091e03b3a77ee0a909bb724dac16a0e628d172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 31 Oct 2019 17:05:44 +0200 Subject: [PATCH 01/20] Update package.json --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 46913de5..9c3d8409 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ "dblapi.js": "^2.3.0", "discord.js": "^11.5.1", "dotenv": "^8.2.0", - "ffmpeg-binaries": "^4.0.0", "firebase": "^6.6.2", "firebase-admin": "^8.6.1", "fs": "0.0.1-security", From 3c3df91675107850622f24dbf173130657f0a1da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 31 Oct 2019 20:47:39 +0200 Subject: [PATCH 02/20] Update index.js --- index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/index.js b/index.js index 57b0aa7e..d1d37390 100644 --- a/index.js +++ b/index.js @@ -40,7 +40,6 @@ client.funcs.exe = require('./funcs/exe.js'); client.config = { token: process.env.TOKEN, apikey: process.env.API_KEY, - botId: "607266889537945605", devId: "360363051792203779", prefix: '>', }; From 9b98935e9d86c7b5825a71856b7a8a90d6884af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 31 Oct 2019 20:49:23 +0200 Subject: [PATCH 03/20] Update message.js --- events/message.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events/message.js b/events/message.js index dc18f6e6..e6c9ab6a 100644 --- a/events/message.js +++ b/events/message.js @@ -30,7 +30,7 @@ module.exports = { const args = message.content.slice(prefix.length).split(' '); let commandName; if (message.mentions.users.first()) { - if (message.mentions.users.first().id === client.config.botId) { + if (message.mentions.users.first().id === client.user.id) { if (!args[1]) return; if (args[1] === 'prefix') return message.channel.send(`My prefix here is: \`${prefix}\`.`); commandName = args[1].toLowerCase(); From 2820622a709e32871eda547a3cb27928c8c445d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 31 Oct 2019 21:05:51 +0200 Subject: [PATCH 04/20] Update index.js process.env.DISCORD_TOKEN process.env.DISCORD_DEV_UID process.env.DISCORD_DEBUG_CHANNEL_ID process.env.YOUTUBE_KEY process.env.DBL_TOKEN process.env.PREFIX --- index.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index d1d37390..b94c7cb1 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ const Discord = require('discord.js'); const client = new Discord.Client({ disableEveryone: true, disabledEvents: ['TYPING_START'] }); const DBL = require("dblapi.js"); -const dbl = new DBL(process.env.DBLTOKEN, client); +const dbl = new DBL(process.env.DBL_TOKEN, client); const fs = require('fs'); const dotenv = require('dotenv'); const firebase = require('firebase/app'); @@ -38,10 +38,11 @@ client.funcs.dbget = require('./funcs/dbget.js'); client.funcs.exe = require('./funcs/exe.js'); client.config = { - token: process.env.TOKEN, - apikey: process.env.API_KEY, - devId: "360363051792203779", - prefix: '>', + token: process.env.DISCORD_TOKEN, + debug_channel: process.env.DISCORD_DEBUG_CHANNEL_ID, + apikey: process.env.YOUTUBE_KEY, + devId: process.env.DISCORD_DEV_UID, + prefix: process.env.PREFIX }; const commandFiles = fs.readdirSync('./commands/').filter(f => f.endsWith('.js')); From 3fec29be3b465a7436a64ef658388e7ed4211548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 31 Oct 2019 21:08:45 +0200 Subject: [PATCH 05/20] Update exe.js --- funcs/exe.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/funcs/exe.js b/funcs/exe.js index 632d180a..b3bdc73b 100644 --- a/funcs/exe.js +++ b/funcs/exe.js @@ -10,6 +10,6 @@ module.exports = function (message, args, client, Discord, prefix, command) { .setDescription(error.stack.replace(/at /g, '**at **')) .setColor('#b50002'); client.fetchUser(client.global.devId).then(user => user.send(embed)).catch(console.error); - client.channels.get('634718645188034560').send(embed); + client.channels.get(client.config.debug_channel).send(embed); } -}; \ No newline at end of file +}; From 17c1369765fa7dca747ea51352bc76750840c393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 31 Oct 2019 21:09:35 +0200 Subject: [PATCH 06/20] Update handleVideo.js --- funcs/handleVideo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/funcs/handleVideo.js b/funcs/handleVideo.js index f9f53cfd..1ad9a3d7 100644 --- a/funcs/handleVideo.js +++ b/funcs/handleVideo.js @@ -32,7 +32,7 @@ module.exports = async function (video, message, voiceChannel, client, playlist client.funcs.play(message.guild, construct.songs[0], client, message, 0, true); } catch (error) { client.queue.delete(message.guild.id); - client.channels.get('634718645188034560').send("Error with connecting to voice channel: " + error); + client.channels.get(client.config.debug_channel).send("Error with connecting to voice channel: " + error); return message.channel.send(`:x: An error occured: ${error}`); } } else { @@ -41,4 +41,4 @@ module.exports = async function (video, message, voiceChannel, client, playlist return message.channel.send(`:white_check_mark: **${song.title}** has been added to the queue!`); } return undefined; -} \ No newline at end of file +} From 6f893516d8151f4bdac9a8681779befcba036147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 31 Oct 2019 21:10:24 +0200 Subject: [PATCH 07/20] Update playlist.js --- commands/playlist.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/playlist.js b/commands/playlist.js index 33f259ac..92a047fe 100644 --- a/commands/playlist.js +++ b/commands/playlist.js @@ -38,7 +38,7 @@ module.exports = { .setDescription(error.stack.replace(/at /g, '**at **')) .setColor('#b50002'); client.fetchUser(client.config.devId).then(user => user.send(embed)).catch(console.error); - client.channels.get('634718645188034560').send(embed); + client.channels.get(client.config.debug_channel).send(embed); console.log(error); } } else { From 1cc363d6c8f7c3958be95e85981dc51c856aa9f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 31 Oct 2019 21:10:53 +0200 Subject: [PATCH 08/20] Update settings.js --- commands/settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/settings.js b/commands/settings.js index c5022aec..efad45c4 100644 --- a/commands/settings.js +++ b/commands/settings.js @@ -32,7 +32,7 @@ module.exports = { .setDescription(error.stack.replace(/at /g, '**at **')) .setColor('#b50002'); client.fetchUser(client.config.devId).then(user => user.send(embed)).catch(console.error); - client.channels.get('634718645188034560').send(embed); + client.channels.get(client.config.debug_channel).send(embed); } } else { return message.channel.send(embed); From 3166c44ac832c81dfa035157048db3bce8cfc2f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 31 Oct 2019 23:32:47 +0200 Subject: [PATCH 09/20] Update ready.js --- events/ready.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/events/ready.js b/events/ready.js index 34620cc1..e4d2070c 100644 --- a/events/ready.js +++ b/events/ready.js @@ -10,7 +10,7 @@ module.exports = { client.global.db.playlists[guildData.id] = guildData.d; }); console.log('- DB Set -'); - client.user.setActivity(`@musix help | 🎶`, { type: 'LISTENING' }); + client.user.setActivity(`@${client.user.username} help | 🎶`, { type: 'LISTENING' }); client.user.setStatus('dnd'); dbl.postStats(client.guilds.size); console.log('- Activated -'); @@ -18,7 +18,7 @@ module.exports = { client.guilds.forEach(guild => { users += guild.memberCount; }) - let status = [`${users} users on ${client.guilds.size} guilds!`, '@musix help | 🎶']; + let status = [`${users} users on ${client.guilds.size} guilds!`, `@${client.user.username} help | 🎶`]; let i = 0; setInterval(() => { if (i == status.length) { From 363f7fa49c6bb13ef19ef8881fb48684a8737957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 31 Oct 2019 23:35:57 +0200 Subject: [PATCH 10/20] Update guildcreate.js --- events/guildcreate.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/events/guildcreate.js b/events/guildcreate.js index f137c774..4c6eee58 100644 --- a/events/guildcreate.js +++ b/events/guildcreate.js @@ -2,7 +2,7 @@ module.exports = { name: 'guildcreate', async execute(client, guild) { client.db.collection('guilds').doc(guild.id).set({ - prefix: '>', + prefix: client.config.prefix, defaultVolume: 5, permissions: false, premium: false, @@ -11,7 +11,7 @@ module.exports = { startPlaying: true }); client.global.db.guilds[guild.id] = { - prefix: ">", + prefix: client.config.prefix, defaultVolume: 5, permissions: false, premium: false, From 9210c41d83877aee1c7bab777d367a5937b6a1b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 31 Oct 2019 23:40:50 +0200 Subject: [PATCH 11/20] Update message.js --- events/message.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/events/message.js b/events/message.js index e6c9ab6a..febdbc20 100644 --- a/events/message.js +++ b/events/message.js @@ -2,7 +2,7 @@ module.exports = { name: 'message', async execute(client, message, Discord) { if (message.author.bot || !message.guild) return; - if (message.content === '->reset' && message.author.id === client.global.devId) { + if (message.content === '->reset' && message.author.id === client.config.devId) { client.guilds.forEach(guild => { client.global.db.guilds[guild.id] = { prefix: client.config.prefix, @@ -15,7 +15,7 @@ module.exports = { return message.channel.send(':white_check_mark: Reset all guild settings for __all__ guilds!'); }); return message.channel.send(':white_check_mark: Reset all guild settings!') - } else if (message.content === '->resetguildsettings' && message.author.id === client.global.devId) { + } else if (message.content === '->resetguildsettings' && message.author.id === client.config.devId) { client.global.db.guilds[message.guild.id] = { prefix: client.config.prefix, defaultVolume: 5, From b5590e1c7f568741987259a4cf25d87e1a8259e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 31 Oct 2019 23:42:23 +0200 Subject: [PATCH 12/20] Update playlist.js --- commands/playlist.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/playlist.js b/commands/playlist.js index 92a047fe..afb199b2 100644 --- a/commands/playlist.js +++ b/commands/playlist.js @@ -19,7 +19,7 @@ module.exports = { .setAuthor(client.user.username, client.user.displayAvatarURL) .setColor('#b50002') const permissions = message.channel.permissionsFor(message.author); - if (message.author.id !== client.global.devId) { + if (message.author.id !== client.config.devId) { if (client.global.db.guilds[message.guild.id].dj) { if (!message.member.roles.has(client.global.db.guilds[message.guild.id].djrole)) return message.channel.send(':x: You need the `DJ` role to modify or play the playlist!'); } else if (!permissions.has('MANAGE_GUILD')) return message.channel.send(':x: You need the `MANAGE_SERVER` permission to modify the playlist!'); From 2cae32c92681f0c1d69e8d6d0ac34ef088facc9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 31 Oct 2019 23:43:43 +0200 Subject: [PATCH 13/20] Update loop.js --- commands/loop.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/loop.js b/commands/loop.js index 9655089c..141ef75d 100644 --- a/commands/loop.js +++ b/commands/loop.js @@ -8,7 +8,7 @@ module.exports = { const permissions = message.channel.permissionsFor(message.author); const { voiceChannel } = message.member; if (serverQueue) { - if (message.author.id !== client.global.devId) { + if (message.author.id !== client.config.devId) { if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to loop the queue!'); if (client.global.db.guilds[message.guild.id].permissions === true) { if (client.global.db.guilds[message.guild.id].dj) { From a637d929f556d59a05c77841d32e7048b9387a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 31 Oct 2019 23:44:37 +0200 Subject: [PATCH 14/20] Update pause.js --- commands/pause.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/pause.js b/commands/pause.js index 955d7cf6..9c0a770d 100644 --- a/commands/pause.js +++ b/commands/pause.js @@ -9,7 +9,7 @@ module.exports = { const { voiceChannel } = message.member; if (serverQueue && serverQueue.playing === true) { if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to pause the music!'); - if (message.author.id !== client.global.devId) { + if (message.author.id !== client.config.devId) { if (client.global.db.guilds[message.guild.id].permissions === true) { if (client.global.db.guilds[message.guild.id].dj) { if (!message.member.roles.has(client.global.db.guilds[message.guild.id].djrole)) return message.channel.send(':x: You need the `DJ` role to pause the music!'); @@ -22,4 +22,4 @@ module.exports = { } return message.channel.send(':x: There is nothing playing.'); } -}; \ No newline at end of file +}; From 82b2bc99163ad1b5a47f6f020f7c0d0b77da93e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 31 Oct 2019 23:45:16 +0200 Subject: [PATCH 15/20] Update resume.js --- commands/resume.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/resume.js b/commands/resume.js index 152d9c75..fddc4e55 100644 --- a/commands/resume.js +++ b/commands/resume.js @@ -8,7 +8,7 @@ module.exports = { const permissions = message.channel.permissionsFor(message.author); const { voiceChannel } = message.member; if (serverQueue && !serverQueue.playing) { - if (message.author.id !== client.global.devId) { + if (message.author.id !== client.config.devId) { if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to loop the queue!'); if (client.global.db.guilds[message.guild.id].permissions === true) { if (client.global.db.guilds[message.guild.id].dj) { From e101d780e71dbaf82c1bbfdde699cf810c6680a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 31 Oct 2019 23:45:58 +0200 Subject: [PATCH 16/20] Update forcestop.js --- commands/forcestop.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/forcestop.js b/commands/forcestop.js index 4548ea13..3e0ddb71 100644 --- a/commands/forcestop.js +++ b/commands/forcestop.js @@ -4,7 +4,7 @@ module.exports = { alias: 'fs', cooldown: 5, execute(message, args, client, Discord, prefix) { - if (message.author.id !== client.global.devId) return message.channel.send(':x: You are not allowed to do that!') + if (message.author.id !== client.config.devId) return message.channel.send(':x: You are not allowed to do that!') client.queue.delete(message.guild.id); message.channel.send('queue deleted') } From e6263db9339b8a61bee4878234a4c266704be8cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 31 Oct 2019 23:47:17 +0200 Subject: [PATCH 17/20] Update exe.js --- funcs/exe.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/funcs/exe.js b/funcs/exe.js index b3bdc73b..3d1c9382 100644 --- a/funcs/exe.js +++ b/funcs/exe.js @@ -9,7 +9,7 @@ module.exports = function (message, args, client, Discord, prefix, command) { .setTitle(`Musix ${error.toString()}`) .setDescription(error.stack.replace(/at /g, '**at **')) .setColor('#b50002'); - client.fetchUser(client.global.devId).then(user => user.send(embed)).catch(console.error); + client.fetchUser(client.config.devId).then(user => user.send(embed)).catch(console.error); client.channels.get(client.config.debug_channel).send(embed); } }; From 8f4df31a666c8a49536eea796f2c1ffaaa2dabd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 31 Oct 2019 23:48:38 +0200 Subject: [PATCH 18/20] Update remove.js --- commands/remove.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/remove.js b/commands/remove.js index e4be9583..783a3a0f 100644 --- a/commands/remove.js +++ b/commands/remove.js @@ -13,7 +13,7 @@ module.exports = { if (isNaN(pos)) return message.channel.send(':x: You need to enter a number!'); if (pos === 0) return message.channel.send(':x: You can not remove the currently playing song!'); if (pos > serverQueue.songs.size) return message.channel.send(`:x: There is only ${serverQueue.songs.size} amount of songs in the queue!`); - if (message.author.id !== client.global.devId) { + if (message.author.id !== client.config.devId) { if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to remove songs!'); if (client.global.db.guilds[message.guild.id].dj) { if (serverQueue.songs[pos].author !== message.author) { From c17baf973a78e3121b8b71494bbe67c740681752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 31 Oct 2019 23:49:14 +0200 Subject: [PATCH 19/20] Update seek.js --- commands/seek.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/seek.js b/commands/seek.js index e7b03d9d..57b8f361 100644 --- a/commands/seek.js +++ b/commands/seek.js @@ -10,7 +10,7 @@ module.exports = { const { voiceChannel } = message.member; let data = await Promise.resolve(ytdl.getInfo(serverQueue.songs[0].url)); if (serverQueue) { - if (message.author.id !== client.global.devId) { + if (message.author.id !== client.config.devId) { return message.channel.send(':x: This command is currently disabled!'); if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to seek the song!'); if (client.global.db.guilds[message.guild.id].permissions === true) { From 41022e98c096787592542084759e54b619a0bc12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 31 Oct 2019 23:49:48 +0200 Subject: [PATCH 20/20] Update eval.js --- commands/eval.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/eval.js b/commands/eval.js index 8065592c..6f2cbe40 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -9,7 +9,7 @@ module.exports = { if (serverQueue) { let data = await Promise.resolve(ytdl.getInfo(serverQueue.songs[0].url)); } - if (message.author.id !== client.global.devId) return message.channel.send(':x: You are not allowed to do that!'); + if (message.author.id !== client.config.devId) return message.channel.send(':x: You are not allowed to do that!'); const input = message.content.slice(prefix.length + 4); let output; try { @@ -23,4 +23,4 @@ module.exports = { .setDescription(`Input: \`\`\`js\n${input.replace(/; /g, ';').replace(/;/g, ';\n')}\n\`\`\`\nOutput: \`\`\`\n${output}\n\`\`\``); return message.channel.send(embed); }, -}; \ No newline at end of file +};