diff --git a/events/msg.js b/events/msg.js index 4881522b..71f8edd1 100644 --- a/events/msg.js +++ b/events/msg.js @@ -3,7 +3,7 @@ module.exports = { async execute(client, msg, Discord) { if (msg.author.bot || !msg.guild) return; let prefix = client.global.db.guilds[msg.guild.id].prefix; - if (client.config.devMode) prefix = "-"; + if (client.config.devMode) prefix = client.config.devPrefix; const args = msg.content.slice(prefix.length).split(' '); if (msg.mentions.users.first()) { if (msg.mentions.users.first().id === client.user.id) { @@ -17,11 +17,11 @@ module.exports = { } if (!msg.content.startsWith(prefix)) return; if (!args[0]) return; - if (client.config.devMode && msg.member.id !== client.config.devId) return msg.channel.send('<:redx:674263474704220182> Dev mode has been turned on! Commands are only available to developer(s)!'); const commandName = args[0].toLowerCase(); const command = client.commands.get(commandName) || client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName)) || client.commandAliases.get(commandName); if (!command && msg.content !== `${prefix}`) return; if (command.onlyDev && msg.author.id !== client.config.devId) return msg.channel.send('<:redx:674263474704220182> You are not allowed to do that!'); + if (client.config.devMode && msg.member.id !== client.config.devId) return msg.channel.send('<:redx:674263474704220182> Dev mode has been turned on! Commands are only available to developer(s)!'); client.funcs.exe(msg, args, client, Discord, prefix, command); } } diff --git a/events/ready.js b/events/ready.js index 162aff35..3460abe0 100644 --- a/events/ready.js +++ b/events/ready.js @@ -7,7 +7,8 @@ module.exports = { remoteMusixGuildsData.forEach(guildData => { client.global.db.guilds[guildData.id] = guildData.d; }); - if (client.devMode) { + if (client.config.devMode) { + console.log('dev mode'); client.guilds.cache.forEach(guild => { client.global.db.guilds[guild.id] = { prefix: client.config.prefix, @@ -15,7 +16,8 @@ module.exports = { permissions: client.config.permissions, dj: client.config.dj, djrole: client.config.djrole, - startPlaying: client.config.startPlaying + startPlaying: client.config.startPlaying, + bass: client.config.bass, }; }); } @@ -41,7 +43,8 @@ module.exports = { premium: client.global.db.guilds[guild.id].premium, dj: client.global.db.guilds[guild.id].dj, djrole: client.global.db.guilds[guild.id].djrole, - startPlaying: client.global.db.guilds[guild.id].startPlaying + startPlaying: client.global.db.guilds[guild.id].startPlaying, + bass: client.global.db.guilds[guild.id].bass, }); }); } diff --git a/struct/config/config.js b/struct/config/config.js index f33d8e7e..4aa5c3fa 100644 --- a/struct/config/config.js +++ b/struct/config/config.js @@ -20,9 +20,11 @@ module.exports = { saveDB: true, //db values prefix: ">", + devPrefix: "-", defaultVolume: 5, permissions: false, dj: false, djrole: null, startPlaying: true, + bass: false, } diff --git a/struct/funcs/play.js b/struct/funcs/play.js index 84726e7d..f2c79ecf 100644 --- a/struct/funcs/play.js +++ b/struct/funcs/play.js @@ -2,6 +2,7 @@ module.exports = async function (guild, song, client, seek, play) { const Discord = require('discord.js'); const ytdl = require('ytdl-core'); const getThumb = require('video-thumbnail-url'); + const prism = require('prism-media'); const serverQueue = client.queue.get(guild.id); if (!song) { @@ -10,8 +11,9 @@ module.exports = async function (guild, song, client, seek, play) { client.queue.delete(guild.id); return; } + const dispatcher = serverQueue.connection - .play(await ytdl(song.url, { filter: "audio", highWaterMark: /*512*/1 << 25, volume: false }), { seek: seek, bitrate: 1024, passes: 10, volume: 1 }) + .play(ytdl(song.url), { filter: "audio", highWaterMark: 1 << 25, volume: false, seek: seek, bitrate: 1024, passes: 10, bassboost: client.global.db.guilds[guild.id].bass }) .on("finish", reason => { client.dispatcher.finish(client, reason, guild); });