fix(verify): change getMillisecond to getTime

This commit is contained in:
smyalygames 2022-10-20 16:44:26 +01:00
parent 7f3f31d9f0
commit 44d913b863
2 changed files with 5 additions and 12 deletions

View File

@ -40,17 +40,10 @@ class VerificationReady extends Listener {
const timeout = await blockTime(user.id);
if (timeout > 0) {
roles.push(IDs.roles.verifyBlock);
await user.roles.add(roles);
// @ts-ignore
this.container.tasks.create('verifyUnblock', {
userId: user.id,
guildId: user.guild.id,
}, timeout);
} else {
// Add roles if they don't have verification block
await user.roles.add(roles);
}
// Add roles if they don't have verification block
await user.roles.add(roles);
}
}

View File

@ -218,13 +218,13 @@ export async function blockTime(userId: string) {
if (verification.activist) {
return 0;
}
const timeOff = new Date().getMilliseconds() - verification.finishTime.getMilliseconds();
const timeOff = new Date().getTime() - verification.finishTime.getTime();
return ((verification.vegan || verification.convinced) ? 604800000 : 1814400000) - timeOff;
}
// Timeouts
const count = await countIncomplete(verification.userId) % (leaveBan + 1);
const timeOff = new Date().getMilliseconds() - verification.joinTime.getMilliseconds();
const timeOff = new Date().getTime() - verification.joinTime.getTime();
// Creates the length of the time for the ban
return (fibonacci(count) * 10000) - timeOff; // TODO * 3600 commented because development
}