ignore commands from users on probation

This commit is contained in:
Lea 2023-03-17 17:30:36 +01:00
parent ee51bf161c
commit f7fb98f043
Signed by: Lea
GPG key ID: 1BAFFE8347019C42

View file

@ -208,6 +208,12 @@ client.on('message', async (message) => {
if (args.shift()?.toLowerCase() != '/kibby') return;
const privileged = message.member?.hasPermission(message.channel?.server!, 'ManageMessages');
if (!privileged && db.data?.probation.includes(message.author_id)) {
console.log('Ignoring user on probation');
return;
}
if (!PUBLIC_COMMANDS.includes(args[0]?.toLowerCase()) && !privileged) {
console.log('User has no permission');
return;