1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-07-07 01:20:48 +00:00

Fix code to work on this decade 1/x

This commit is contained in:
Christer Warén
2024-02-10 09:33:59 +02:00
parent 99ecd9787d
commit 86b4676159
61 changed files with 3842 additions and 471 deletions

34
src/funcs/check.js Normal file
View File

@ -0,0 +1,34 @@
module.exports = function (client, msg, command) {
const queue = client.queue.get(msg.guild.id);
const permissions = msg.channel.permissionsFor(msg.author);
if (!queue || !queue.playing && command.name !== "stop") {
msg.channel.send(client.messages.noServerQueue);
return false;
}
if (msg.author.id !== client.config.devId) {
if (msg.member.voice.channel !== queue.voiceChannel) {
msg.channel.send(client.messages.wrongVoiceChannel);
return false;
}
if (client.global.db.guilds[msg.guild.id].permissions === true) {
if (client.global.db.guilds[msg.guild.id].dj) {
if (
!msg.member.roles.cache.has(
client.global.db.guilds[msg.guild.id].djrole
)
) {
msg.channel.send(client.messages.noDj);
return false;
} else return true;
} else if (!permissions.has(command.permission)) {
let message;
message = client.messages.noPerms.replace(
"%PERMS%",
command.permissions
);
msg.channel.send(message);
return false;
} else return true;
} else return true;
} else return true;
};