1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-06-16 18:56:00 +00:00
This commit is contained in:
MatteZ02
2020-02-20 22:31:03 +02:00
parent 6c0ed31c1b
commit 282ac01b3b
4 changed files with 13 additions and 6 deletions

View File

@ -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);
}
}

View File

@ -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,
});
});
}