Merge branch 'dev' into 'main'

Dev

See merge request illegitimate/illegitimate-bot!231
This commit is contained in:
2024-02-19 17:07:29 +00:00
4 changed files with 21 additions and 5 deletions

View File

@@ -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,

View File

@@ -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,

View File

@@ -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

View File

@@ -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,