Update commands now change username to username (x) format
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user