Skip to content

Commit

Permalink
feat: unverify users
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlauer-Hax committed Jun 7, 2023
1 parent 2113518 commit ae6db8c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions interactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,13 @@ export async function handleInteraction(interaction: Interaction, db: DB) {
const role = interaction.guild.roles.cache.get("757983851032215673")

if (member && role) {
member.roles.add(role, "Verified by " + interaction.user.tag)
interaction.reply("Successfully verified <@" + interaction.values[0] + ">!")
if (member.roles.cache.has(role.id)) {
member.roles.remove(role, "Unverified by " + interaction.user.tag)
interaction.reply("Successfully unverified <@" + interaction.values[0] + ">!")
} else {
member.roles.add(role, "Verified by " + interaction.user.tag)
interaction.reply("Successfully verified <@" + interaction.values[0] + ">!")
}
} else {
interaction.reply("An error occured while assigning the role to <@" + interaction.values[0] + ">")
}
Expand Down Expand Up @@ -88,15 +93,15 @@ export async function handleInteraction(interaction: Interaction, db: DB) {
value: `> ${await db.getServerURLs(interaction.user.id)}`,
}, {
name: `Last Login:`,
value: '```'+JSON.stringify(login[0])+'```',
value: '```' + JSON.stringify(login[0]) + '```',
});
embed.setFooter({
text: login[1] as string,
iconURL: interaction.user.displayAvatarURL(),
})
embed.setTimestamp(new Date(new Date().toLocaleString('en-US', { timeZone: login[2] })))
}


setTimeout(() => {
ch.permissionOverwrites.create(interaction.user.id, {
Expand Down

0 comments on commit ae6db8c

Please sign in to comment.