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/*
|
||||||
logs
|
logs/ERROR.txt
|
||||||
|
logs/TEXT.txt
|
||||||
*.log
|
*.log
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
|
|||||||
+10
-9
@@ -38,15 +38,16 @@ module.exports = {
|
|||||||
message.guild.id,
|
message.guild.id,
|
||||||
message.member,
|
message.member,
|
||||||
);
|
);
|
||||||
if (
|
|
||||||
(permissionLevel <= command.permission) &&
|
|
||||||
(client.config.owners.includes(!message.author.id) /*||
|
if (!client.config.owners.includes(message.author.id)) {
|
||||||
(!message.guild.ownerId == message.author.id)*/
|
if (message.guild.ownerId !== message.author.id) {
|
||||||
)
|
if (permissionLevel < command.permission) {
|
||||||
) {
|
return message.reply(
|
||||||
return message.reply(
|
"Vous n'avez pas la permission d'utiliser cette commande.",
|
||||||
"Vous n'avez pas la permission d'utiliser cette commande.",
|
);
|
||||||
);
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
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;
|
return highestPermission;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user