Some trickery.
This commit is contained in:
@@ -6,12 +6,11 @@ async function newUserKicker(member) {
|
||||
const threshold = db.newUserKickerThreshold;
|
||||
|
||||
const accountAge = (Date.now() - member.user.createdAt) / (1000 * 60 * 60 * 24);
|
||||
console.log(`Account age of ${member.user.tag}: ${accountAge} days.`);
|
||||
if (accountAge <= threshold) {
|
||||
member.kick('Account age is less than the threshold.');
|
||||
console.log(`Account age of ${member.user.tag} is less than the threshold. Kicked.`);
|
||||
console.log(`Account age of ${member.user.tag} is ${accountAge.toFixed(0)} day(s) which is lower than the threshold. Kicked.`);
|
||||
} else {
|
||||
console.log(`Account age of ${member.user.tag} is greater than the threshold. Not kicked.`);
|
||||
console.log(`Account age of ${member.user.tag} is ${accountAge.toFixed(0)} day(s) which is higher than the threshold. Not kicked.`);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user