1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-22 18:03:17 +00:00
musix-oss/commands/settings/permissions.js
2024-02-09 11:53:30 +02:00

18 lines
1.1 KiB
JavaScript

module.exports = {
name: 'permissions',
async execute(message, args, client, prefix) {
if (!args[2]) return message.channel.send(`🔒 Permission requirement: \`${client.global.db.guilds[message.guild.id].permissions}\``);
if (args[2] === 'true') {
if (!client.global.db.guilds[message.guild.id].permissions) {
client.global.db.guilds[message.guild.id].permissions = true;
message.channel.send(`:white_check_mark: Permissions requirement now set to: \`true\``);
} else return message.channel.send(':x: That value is already `true`!');
} else if (args[2] === 'false') {
if (client.global.db.guilds[message.guild.id].permissions) {
client.global.db.guilds[message.guild.id].permissions = false;
message.channel.send(`:white_check_mark: Permissions requirement now set to: \`false\``);
} else return message.channel.send(':x: That value is already `false`!');
} else return message.channel.send(':x: Please define a boolean! (true/false)');
}
};