1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-11-14 03:30:18 +00:00
musix-oss/commands/settings/permissions.js

17 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-02-05 20:02:53 +00:00
module.exports = {
name: 'permissions',
async execute(msg, args, client, Discord, prefix) {
if (!args[2]) return msg.channel.send(`🔒 Permission requirement: \`${client.global.db.guilds[msg.guild.id].permissions}\``);
if (args[2] === 'true') {
if (!client.global.db.guilds[msg.guild.id].permissions) {
client.global.db.guilds[msg.guild.id].permissions = true;
msg.channel.send(`<:green_check_mark:674265384777416705> Permissions requirement now set to: \`true\``);
} else return msg.channel.send('<:redx:674263474704220182> That value is already `true`!');
} else if (args[2] === 'false') {
if (client.global.db.guilds[msg.guild.id].permissions) {
client.global.db.guilds[msg.guild.id].permissions = false;
msg.channel.send(`<:green_check_mark:674265384777416705> Permissions requirement now set to: \`false\``);
} else return msg.channel.send('<:redx:674263474704220182> That value is already `false`!');
} else return msg.channel.send('<:redx:674263474704220182> Please define a boolean! (true/false)');
}
};