Merge branch 'dev' into 'main'
Dev See merge request illegitimate/illegitimate-bot!231
This commit is contained in:
@@ -26,9 +26,12 @@ export = {
|
|||||||
const verifyData = await verifySchema.findOne({ userID: user.user.id })
|
const verifyData = await verifySchema.findOne({ userID: user.user.id })
|
||||||
|
|
||||||
if (!verifyData) {
|
if (!verifyData) {
|
||||||
|
await user.setNickname(`${user.user.username} (X)`, "User used the update command").catch(() => {
|
||||||
|
// Do nothing
|
||||||
|
})
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "User is not verified.",
|
description: "User is not verified.\n\n" + "Updating username to `Username (X)`",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
|
|||||||
@@ -32,9 +32,12 @@ export = {
|
|||||||
const verifyData = await verify.findOne({ userID: user.user.id })
|
const verifyData = await verify.findOne({ userID: user.user.id })
|
||||||
|
|
||||||
if (!verifyData) {
|
if (!verifyData) {
|
||||||
|
await user.setNickname(`${user.user.username} (X)`, "User used the update command").catch(() => {
|
||||||
|
// Do nothing
|
||||||
|
})
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "User is not verified.",
|
description: "User is not verified.\n\n" + "Updating username to `Username (X)`",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
|
|||||||
@@ -64,12 +64,19 @@ export default async function updateAll(interaction: ChatInputCommandInteraction
|
|||||||
for (const gmember of guildMembers) {
|
for (const gmember of guildMembers) {
|
||||||
const memberData = verifiedUsers.find(user => user.userID === gmember.id)
|
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++
|
i++
|
||||||
|
|
||||||
if (!memberData) {
|
if (!memberData) {
|
||||||
|
if (gmember.member.user.bot) {
|
||||||
|
console.log(color(" Skipped bot", "lavender"))
|
||||||
|
continue
|
||||||
|
}
|
||||||
const rolesToremove = roleManage("default").rolesToRemove
|
const rolesToremove = roleManage("default").rolesToRemove
|
||||||
await gmember.member.roles.remove(rolesToremove, "Updating all discord members")
|
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 {
|
} else {
|
||||||
const uuid = memberData.uuid
|
const uuid = memberData.uuid
|
||||||
const ign = await getIGN(uuid)
|
const ign = await getIGN(uuid)
|
||||||
@@ -119,7 +126,7 @@ export default async function updateAll(interaction: ChatInputCommandInteraction
|
|||||||
|
|
||||||
console.log("Successfully updated all roles.")
|
console.log("Successfully updated all roles.")
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.channel?.send({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "Successfully updated all roles.",
|
description: "Successfully updated all roles.",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
|
|||||||
@@ -24,9 +24,12 @@ export = {
|
|||||||
const verifyData = await verify.findOne({ userID: user.user.id })
|
const verifyData = await verify.findOne({ userID: user.user.id })
|
||||||
|
|
||||||
if (!verifyData) {
|
if (!verifyData) {
|
||||||
|
await user.setNickname(`${user.user.username} (X)`, "User used the update command").catch(() => {
|
||||||
|
// Do nothing
|
||||||
|
})
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
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,
|
color: embedColor,
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
|
|||||||
Reference in New Issue
Block a user