mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-05-19 15:04:29 +02:00
fix(verify): change getMillisecond to getTime
This commit is contained in:
parent
7f3f31d9f0
commit
44d913b863
@ -40,17 +40,10 @@ class VerificationReady extends Listener {
|
|||||||
const timeout = await blockTime(user.id);
|
const timeout = await blockTime(user.id);
|
||||||
if (timeout > 0) {
|
if (timeout > 0) {
|
||||||
roles.push(IDs.roles.verifyBlock);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,13 +218,13 @@ export async function blockTime(userId: string) {
|
|||||||
if (verification.activist) {
|
if (verification.activist) {
|
||||||
return 0;
|
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;
|
return ((verification.vegan || verification.convinced) ? 604800000 : 1814400000) - timeOff;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Timeouts
|
// Timeouts
|
||||||
const count = await countIncomplete(verification.userId) % (leaveBan + 1);
|
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
|
// Creates the length of the time for the ban
|
||||||
return (fibonacci(count) * 10000) - timeOff; // TODO * 3600 commented because development
|
return (fibonacci(count) * 10000) - timeOff; // TODO * 3600 commented because development
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user