feat(verification): add info to be collected

This commit is contained in:
Anthony 2022-08-19 03:51:42 +01:00
parent 300ad9a903
commit 4883ec12a1
2 changed files with 30 additions and 8 deletions

View File

@ -48,16 +48,19 @@ model User {
}
model Verify {
id Int @id @default(autoincrement())
user User @relation("verUser", fields: [userId], references: [id])
id String @id
user User @relation("verUser", fields: [userId], references: [id])
userId String
verifier User? @relation("verVerifier", fields: [verifierId], references: [id])
verifier User? @relation("verVerifier", fields: [verifierId], references: [id])
verifierId String?
time DateTime @default(now())
timedOut Boolean @default(false) // If they got kicked out of verification because they timed out
vegan Boolean @default(false) // If they got verified as a vegan
text Boolean @default(false) // If they used text verification
serverVegan Boolean @default(false) // People that went vegan on the server
joinTime DateTime @default(now())
startTime DateTime?
finishTime DateTime?
timedOut Boolean @default(false) // If they got kicked out of verification because they timed out
//incomplete Boolean @default(false) // If the verification was incomplete
vegan Boolean @default(false) // If they got verified as a vegan
text Boolean @default(false) // If they used text verification
serverVegan Boolean @default(false) // People that went vegan on the server
notes String?
}

View File

@ -228,6 +228,24 @@ export default class VerificationJoinVCListener extends Listener {
) {
const embedColor = '#0099ff';
const { displayName } = user;
let info = {
page: 0,
find: {
reason: 0,
where: 0,
},
length: 0,
reasoning: 0,
life: 0,
food: 0,
roles: {
vegan: false,
activist: false,
trusted: false,
vegCurious: false,
convinced: false,
},
};
// Create an embeds for each page
const initialEmbed = new MessageEmbed()
@ -320,6 +338,7 @@ export default class VerificationJoinVCListener extends Listener {
// Definitely vegan?
if (button.customId === `yesVegan${id}`) {
await button.deferUpdate();
info.roles.vegan = true;
await message.edit({
embeds: [activistEmbed],
components: [activistButtons],