feat(verification): add verification block after verify

This commit is contained in:
Anthony 2022-09-02 01:20:07 +01:00
parent 0829e7c996
commit 915f7d7048
2 changed files with 14 additions and 8 deletions

View File

@ -462,6 +462,14 @@ class VerificationJoinVCListener extends Listener {
await finishVerification(verId, button.user.id, info); await finishVerification(verId, button.user.id, info);
// Give roles on Discord // Give roles on Discord
await this.giveRoles(user, info.roles); await this.giveRoles(user, info.roles);
// Add timeout if they do not have activist role
if (!info.roles.activist) {
// @ts-ignore
this.container.tasks.create('verifyUnblock', {
userId: user.id,
guildId: guild.id,
}, (info.roles.vegan || info.roles.convinced) ? 604800000 : 1814400000);
}
// Add embed saying verification completed // Add embed saying verification completed
embed = new MessageEmbed() embed = new MessageEmbed()
.setColor('#34c000') .setColor('#34c000')
@ -564,6 +572,8 @@ class VerificationJoinVCListener extends Listener {
} }
if (roles.activist) { if (roles.activist) {
rolesAdd.push(IDs.roles.vegan.activist); rolesAdd.push(IDs.roles.vegan.activist);
} else {
rolesAdd.push(IDs.roles.verifyBlock);
} }
if (roles.trusted) { if (roles.trusted) {
rolesAdd.push(IDs.roles.trusted); rolesAdd.push(IDs.roles.trusted);

View File

@ -76,13 +76,6 @@ class VerificationLeaveVCListener extends Listener {
console.log(userSnowflake); console.log(userSnowflake);
const user = guild.members.cache.get(userSnowflake!)!; const user = guild.members.cache.get(userSnowflake!)!;
/*
// Add the user to the database if it's not a verifier meeting
if (!oldState.channel.name.includes(' - Verification')) {
await finishVerification(oldState.channelId!, true, true, false, false);
}
*/
// Remove verify as vegan and give non vegan role // Remove verify as vegan and give non vegan role
if (!await checkFinish(channel.id)) { if (!await checkFinish(channel.id)) {
await user.roles.remove(IDs.roles.verifyingAsVegan); await user.roles.remove(IDs.roles.verifyingAsVegan);
@ -98,7 +91,10 @@ class VerificationLeaveVCListener extends Listener {
const banLength = fibonacci(incompleteCount) * 10000; // * 3600 commented because development const banLength = fibonacci(incompleteCount) * 10000; // * 3600 commented because development
// @ts-ignore // @ts-ignore
this.container.tasks.create('verifyUnblock', { userId: user.id, guildId: guild.id }, banLength); this.container.tasks.create('verifyUnblock', {
userId: user.id,
guildId: guild.id,
}, banLength);
} }
} }