diff --git a/src/commands-contextmenu/updateuser.ts b/src/commands-contextmenu/updateuser.ts index 47f5895..557010a 100644 --- a/src/commands-contextmenu/updateuser.ts +++ b/src/commands-contextmenu/updateuser.ts @@ -26,9 +26,12 @@ export = { const verifyData = await verifySchema.findOne({ userID: user.user.id }) if (!verifyData) { + await user.setNickname(`${user.user.username} (X)`, "User used the update command").catch(() => { + // Do nothing + }) await interaction.editReply({ embeds: [{ - description: "User is not verified.", + description: "User is not verified.\n\n" + "Updating username to `Username (X)`", color: embedColor, footer: { text: interaction.guild!.name + " | " + devMessage, diff --git a/src/commands/forceupdate.ts b/src/commands/forceupdate.ts index 54203b6..f97d71f 100644 --- a/src/commands/forceupdate.ts +++ b/src/commands/forceupdate.ts @@ -32,9 +32,12 @@ export = { const verifyData = await verify.findOne({ userID: user.user.id }) if (!verifyData) { + await user.setNickname(`${user.user.username} (X)`, "User used the update command").catch(() => { + // Do nothing + }) await interaction.editReply({ embeds: [{ - description: "User is not verified.", + description: "User is not verified.\n\n" + "Updating username to `Username (X)`", color: embedColor, footer: { text: interaction.guild!.name + " | " + devMessage, diff --git a/src/commands/staff/updateall.ts b/src/commands/staff/updateall.ts index 6d5fbc5..836b7e0 100644 --- a/src/commands/staff/updateall.ts +++ b/src/commands/staff/updateall.ts @@ -64,12 +64,19 @@ export default async function updateAll(interaction: ChatInputCommandInteraction for (const gmember of guildMembers) { const memberData = verifiedUsers.find(user => user.userID === gmember.id) - console.log(color("Updating member " + i + " of " + guildMembers.length, "green")) + console.log(color(`Updating ${gmember.member.user.username} [${i}/${guildMembers.length}]`, "green")) i++ if (!memberData) { + if (gmember.member.user.bot) { + console.log(color(" Skipped bot", "lavender")) + continue + } const rolesToremove = roleManage("default").rolesToRemove await gmember.member.roles.remove(rolesToremove, "Updating all discord members") + await gmember.member.setNickname(`${gmember.member.user.username} (X)`, "Updating all discord members").catch(() => { + // Do nothing + }) } else { const uuid = memberData.uuid const ign = await getIGN(uuid) @@ -119,7 +126,7 @@ export default async function updateAll(interaction: ChatInputCommandInteraction console.log("Successfully updated all roles.") - await interaction.editReply({ + await interaction.channel?.send({ embeds: [{ description: "Successfully updated all roles.", color: embedColor diff --git a/src/commands/update.ts b/src/commands/update.ts index a8c59d2..6f42428 100644 --- a/src/commands/update.ts +++ b/src/commands/update.ts @@ -24,9 +24,12 @@ export = { const verifyData = await verify.findOne({ userID: user.user.id }) if (!verifyData) { + await user.setNickname(`${user.user.username} (X)`, "User used the update command").catch(() => { + // Do nothing + }) await interaction.editReply({ embeds: [{ - description: "You are not verified. Please run `/verify` to verify yourself", + description: "You are not verified. Please run `/verify` to verify yourself\n\n" + "Updating username to `Username (X)`", color: embedColor, footer: { text: interaction.guild!.name + " | " + devMessage,