mirror of
https://github.com/arthur-pbty/bot-discord-coins.git
synced 2026-06-03 15:07:20 +02:00
corrige perm bug
This commit is contained in:
+2
-1
@@ -3,7 +3,8 @@ db.sqlite
|
||||
|
||||
# Logs
|
||||
logs/*
|
||||
logs
|
||||
logs/ERROR.txt
|
||||
logs/TEXT.txt
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
|
||||
+10
-9
@@ -38,15 +38,16 @@ module.exports = {
|
||||
message.guild.id,
|
||||
message.member,
|
||||
);
|
||||
if (
|
||||
(permissionLevel <= command.permission) &&
|
||||
(client.config.owners.includes(!message.author.id) /*||
|
||||
(!message.guild.ownerId == message.author.id)*/
|
||||
)
|
||||
) {
|
||||
return message.reply(
|
||||
"Vous n'avez pas la permission d'utiliser cette commande.",
|
||||
);
|
||||
|
||||
|
||||
if (!client.config.owners.includes(message.author.id)) {
|
||||
if (message.guild.ownerId !== message.author.id) {
|
||||
if (permissionLevel < command.permission) {
|
||||
return message.reply(
|
||||
"Vous n'avez pas la permission d'utiliser cette commande.",
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -14,6 +14,11 @@ module.exports = async function getPermissionLevel(serverId, user) {
|
||||
);
|
||||
});
|
||||
|
||||
const highestPermission = Math.max(...perms.map((perm) => perm.permission));
|
||||
let highestPermission;
|
||||
if (perms.length === 0) {
|
||||
highestPermission = 0
|
||||
} else {
|
||||
highestPermission = Math.max(...perms.map((perm) => perm.permission));
|
||||
}
|
||||
return highestPermission;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user