Updated embed props + more

This commit is contained in:
2024-01-07 17:04:37 +01:00
parent c18a5f703f
commit 199e5e6955
19 changed files with 157 additions and 588 deletions

View File

@@ -115,7 +115,7 @@ export = {
embeds: [{ embeds: [{
author: { author: {
name: mod.user.username, name: mod.user.username,
icon_url: mod.user.avatarURL({ forceStatic: false })!, icon_url: mod.user.avatarURL({ forceStatic: false }) || undefined,
}, },
title: "Member Banned", title: "Member Banned",
description: ` description: `
@@ -126,7 +126,7 @@ export = {
`, `,
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: mod.user.avatarURL({ forceStatic: false })!, url: mod.user.avatarURL({ forceStatic: false }) || "",
}, },
footer: { footer: {
text: "ID: " + member.user.id, text: "ID: " + member.user.id,
@@ -151,7 +151,7 @@ export = {
url: member.user.avatarURL({ forceStatic: false }) || "", url: member.user.avatarURL({ forceStatic: false }) || "",
}, },
footer: { footer: {
icon_url: interaction.guild!.iconURL({ forceStatic: false, })!, icon_url: interaction.guild!.iconURL({ forceStatic: false, }) || undefined,
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
}, },
}, },

View File

@@ -306,9 +306,7 @@ export = {
}, },
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL({ icon_url: interaction.guild!.iconURL({ forceStatic: true, }) || undefined,
forceStatic: true,
})!,
}, },
fields: statsFields, fields: statsFields,
}, },

View File

@@ -87,9 +87,7 @@ export = {
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL({ icon_url: interaction.guild!.iconURL({ forceStatic: false, }) || undefined,
forceStatic: false,
})!,
}, },
}, },
], ],

View File

@@ -114,9 +114,8 @@ export = {
if (responseGuildID === hypixelGuildID) { if (responseGuildID === hypixelGuildID) {
const GuildMembers = guild!.members const GuildMembers = guild!.members
const guildRank = GuildMembers.find( const guildRank = GuildMembers.find( member => member.uuid === verifyData.uuid)!.rank
member => member.uuid === verifyData.uuid, let replyRank: string | null = null
)!.rank
await user.roles.add(roleManage("default").rolesToAdd, "User was force updated.") await user.roles.add(roleManage("default").rolesToAdd, "User was force updated.")
@@ -124,181 +123,60 @@ export = {
const roles = roleManage("gm") const roles = roleManage("gm")
await user.roles.remove(roles.rolesToRemove, "User was force updated.") await user.roles.remove(roles.rolesToRemove, "User was force updated.")
await user.roles.add(roles.rolesToAdd, "User was force updated.") await user.roles.add(roles.rolesToAdd, "User was force updated.")
replyRank = "Guild Master"
await interaction.editReply({
embeds: [
{
description:
usermentioned +
"'s rank has been updated to `Guild Master`",
color: embedColor,
thumbnail: {
url: head!,
},
footer: {
text:
interaction.guild!.name +
" | " +
devMessage,
icon_url: interaction.guild!.iconURL({
forceStatic: false,
})!,
},
},
],
})
return
} }
if (guildRank === "Manager") { if (guildRank === "Manager") {
const roles = roleManage("manager") const roles = roleManage("manager")
await user.roles.remove(roles.rolesToRemove, "User was force updated.") await user.roles.remove(roles.rolesToRemove, "User was force updated.")
await user.roles.add(roles.rolesToAdd, "User was force updated.") await user.roles.add(roles.rolesToAdd, "User was force updated.")
replyRank = "Manager"
await interaction.editReply({
embeds: [
{
description:
usermentioned +
"'s rank has been updated to `Manager`",
color: embedColor,
thumbnail: {
url: head!,
},
footer: {
text:
interaction.guild!.name +
" | " +
devMessage,
icon_url: interaction.guild!.iconURL({
forceStatic: false,
})!,
},
},
],
})
return
} }
if (guildRank === "Moderator") { if (guildRank === "Moderator") {
const roles = roleManage("moderator") const roles = roleManage("moderator")
await user.roles.remove(roles.rolesToRemove, "User was force updated.") await user.roles.remove(roles.rolesToRemove, "User was force updated.")
await user.roles.add(roles.rolesToAdd, "User was force updated.") await user.roles.add(roles.rolesToAdd, "User was force updated.")
replyRank = "Moderator"
await interaction.editReply({
embeds: [
{
description:
usermentioned +
"'s rank has been updated to `Moderator`",
color: embedColor,
thumbnail: {
url: head!,
},
footer: {
text:
interaction.guild!.name +
" | " +
devMessage,
icon_url: interaction.guild!.iconURL({
forceStatic: false,
})!,
},
},
],
})
return
} }
if (guildRank === "Beast") { if (guildRank === "Beast") {
const roles = roleManage("beast") const roles = roleManage("beast")
await user.roles.remove(roles.rolesToRemove, "User was force updated.") await user.roles.remove(roles.rolesToRemove, "User was force updated.")
await user.roles.add(roles.rolesToAdd, "User was force updated.") await user.roles.add(roles.rolesToAdd, "User was force updated.")
replyRank = "Beast"
await interaction.editReply({
embeds: [
{
description:
usermentioned +
"'s rank has been updated to `Beast`.",
color: embedColor,
thumbnail: {
url: head!,
},
footer: {
text:
interaction.guild!.name +
" | " +
devMessage,
icon_url: interaction.guild!.iconURL({
forceStatic: false,
})!,
},
},
],
})
return
} }
if (guildRank === "Elite") { if (guildRank === "Elite") {
const roles = roleManage("elite") const roles = roleManage("elite")
await user.roles.remove(roles.rolesToRemove, "User was force updated.") await user.roles.remove(roles.rolesToRemove, "User was force updated.")
await user.roles.add(roles.rolesToAdd, "User was force updated.") await user.roles.add(roles.rolesToAdd, "User was force updated.")
replyRank = "Elite"
await interaction.editReply({
embeds: [
{
description:
usermentioned +
"'s rank has been updated to `Elite`.",
color: embedColor,
thumbnail: {
url: head!,
},
footer: {
text:
interaction.guild!.name +
" | " +
devMessage,
icon_url: interaction.guild!.iconURL({
forceStatic: false,
})!,
},
},
],
})
return
} }
if (guildRank === "Member") { if (guildRank === "Member") {
const roles = roleManage("member") const roles = roleManage("member")
await user.roles.remove(roles.rolesToRemove, "User was force updated.") await user.roles.remove(roles.rolesToRemove, "User was force updated.")
await user.roles.add(roles.rolesToAdd, "User was force updated.") await user.roles.add(roles.rolesToAdd, "User was force updated.")
replyRank = "Member"
await interaction.editReply({
embeds: [
{
description:
usermentioned +
"'s rank has been updated to `Member`.",
color: embedColor,
thumbnail: {
url: head!,
},
footer: {
text:
interaction.guild!.name +
" | " +
devMessage,
icon_url: interaction.guild!.iconURL({
forceStatic: false,
})!,
},
},
],
})
return
} }
await interaction.editReply({
embeds: [
{
description:
usermentioned + " was given the the " + replyRank + " role.",
color: embedColor,
thumbnail: {
url: head!,
},
footer: {
text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL({ forceStatic: false, }) || undefined,
},
},
],
})
} }
}, },
} as Command } as Command

View File

@@ -186,7 +186,7 @@ export = {
embeds: [{ embeds: [{
author: { author: {
name: modName, name: modName,
icon_url: mod.avatarURL({ forceStatic: false })!, icon_url: mod.avatarURL({ forceStatic: false }) || undefined,
}, },
title: "Force Verified", title: "Force Verified",
description: ` description: `
@@ -197,7 +197,7 @@ export = {
`, `,
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: mod.avatarURL({ forceStatic: false })!, url: mod.avatarURL({ forceStatic: false }) || "",
}, },
footer: { footer: {
icon_url: user.user.avatarURL({ forceStatic: false }) || undefined, icon_url: user.user.avatarURL({ forceStatic: false }) || undefined,
@@ -222,10 +222,7 @@ export = {
url: head!, url: head!,
}, },
footer: { footer: {
icon_url: icon_url: interaction.guild!.iconURL({ forceStatic: false, }) || undefined,
interaction.guild!.iconURL({
forceStatic: false,
}) || undefined,
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
}, },
}, },

View File

@@ -66,12 +66,10 @@ export = {
fields: commandList, fields: commandList,
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: interaction.guild!.iconURL({ forceStatic: true })!, url: interaction.guild!.iconURL({ forceStatic: true }) || "",
}, },
footer: { footer: {
icon_url: interaction.guild!.iconURL({ icon_url: interaction.guild!.iconURL({ forceStatic: false, }) || undefined,
forceStatic: false,
})!,
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
}, },
}, },

View File

@@ -32,9 +32,7 @@ export = {
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL({ icon_url: interaction.guild!.iconURL({ forceStatic: false, }) || undefined,
forceStatic: false,
})!,
}, },
image: { image: {
url: instructionsgif, url: instructionsgif,

View File

@@ -82,7 +82,7 @@ export = {
embeds: [{ embeds: [{
author: { author: {
name: mod.user.username, name: mod.user.username,
icon_url: mod.user.avatarURL({ forceStatic: false })!, icon_url: mod.user.avatarURL({ forceStatic: false }) || undefined,
}, },
title: "Member Kicked", title: "Member Kicked",
description: ` description: `
@@ -92,7 +92,7 @@ export = {
`, `,
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: mod.user.avatarURL({ forceStatic: false })!, url: mod.user.avatarURL({ forceStatic: false }) || "",
}, },
footer: { footer: {
text: "ID: " + member.user.id, text: "ID: " + member.user.id,
@@ -111,10 +111,10 @@ export = {
"**Moderator:** " + mod.user.username, "**Moderator:** " + mod.user.username,
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: member.user.avatarURL({ forceStatic: false }) || interaction.guild!.iconURL({ forceStatic: false, })!, url: member.user.avatarURL({ forceStatic: false }) || "",
}, },
footer: { footer: {
icon_url: interaction.guild!.iconURL({ forceStatic: false, })!, icon_url: interaction.guild!.iconURL({ forceStatic: false, }) || undefined,
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
} }
}, },

View File

@@ -94,7 +94,7 @@ export = {
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL({ forceStatic: false }) || "", icon_url: interaction.guild!.iconURL({ forceStatic: false }) || undefined,
} }
}, },
], ],

View File

@@ -35,9 +35,7 @@ export = {
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: url:
interaction?.guild?.iconURL({ interaction.guild!.iconURL({ forceStatic: false, }) || "",
forceStatic: false,
}) || "",
}, },
fields: [ fields: [
{ {
@@ -72,10 +70,7 @@ export = {
], ],
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: icon_url: interaction.guild!.iconURL({ forceStatic: false, }) || undefined,
interaction.guild!.iconURL({
forceStatic: false,
}) || undefined,
}, },
}, },
], ],

View File

@@ -46,15 +46,11 @@ export = {
description: message, description: message,
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: interaction.guild!.iconURL({ url: interaction.guild!.iconURL({ forceStatic: false, }) || "",
forceStatic: false,
})!,
}, },
footer: { footer: {
text: interaction.guild!.id + " | " + devMessage, text: interaction.guild!.id + " | " + devMessage,
icon_url: icon_url: interaction.guild!.iconURL({ forceStatic: true }) || undefined,
interaction.guild!.iconURL({ forceStatic: true }) ||
undefined,
}, },
}, },
], ],
@@ -67,10 +63,7 @@ export = {
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: icon_url: interaction.guild!.iconURL({ forceStatic: false, }) || undefined,
interaction.guild!.iconURL({
forceStatic: false,
}) || undefined,
}, },
}, },
], ],

View File

@@ -96,206 +96,81 @@ export = {
async execute(interaction) { async execute(interaction) {
const subcommand = interaction.options.getSubcommand() const subcommand = interaction.options.getSubcommand()
const channel = interaction.options.getChannel("channel") as TextChannel
const embedColor = Number(color.replace("#", "0x")) const embedColor = Number(color.replace("#", "0x"))
let title: string = ""
let description: string = ""
let customId: string = ""
let label: string = ""
let emoji: string = ""
if (subcommand === "sendguildapplication") { if (subcommand === "sendguildapplication") {
const channel = interaction.options.getChannel("channel") as TextChannel title = "Guild Application"
description = "You can apply for the guild by clicking the button below."
await channel.send({ customId = "guildapply"
embeds: [ label = "Apply"
{ emoji = "✅"
title: "Guild Application",
description:
"You can apply for the guild by clicking the button below.",
color: embedColor,
footer: {
text: interaction.guild!.name + " | " + devMessage,
icon_url:
interaction.guild!.iconURL({
forceStatic: false,
}) || undefined,
},
thumbnail: {
url:
interaction.guild!.iconURL({
forceStatic: false,
}) || "",
},
},
],
components: [
new ActionRowBuilder<ButtonBuilder>().addComponents(
new ButtonBuilder()
.setCustomId("guildapply")
.setLabel("Apply")
.setStyle(ButtonStyle.Primary)
.setEmoji({ name: "✅" }),
),
],
})
await interaction.reply({
content: "Message sent",
ephemeral: true,
})
} }
if (subcommand === "sendstaffapplication") { if (subcommand === "sendstaffapplication") {
const channel = interaction.options.getChannel("channel") as TextChannel title = "Staff Application"
description = "You can apply for the staff team by clicking the button below."
await channel.send({ customId = "staffapply"
embeds: [ label = "Apply"
{ emoji = "✅"
title: "Staff Application",
description:
"You can apply for the staff team by clicking the button below.",
color: embedColor,
footer: {
text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL({
forceStatic: false,
})!,
},
thumbnail: {
url: interaction.guild!.iconURL({
forceStatic: false,
})!,
},
},
],
components: [
new ActionRowBuilder<ButtonBuilder>().addComponents(
new ButtonBuilder()
.setCustomId("staffapply")
.setLabel("Apply")
.setStyle(ButtonStyle.Primary)
.setEmoji({ name: "✅" }),
),
],
})
await interaction.reply({
content: "Message sent",
ephemeral: true,
})
} }
if (subcommand === "sendinactivityapplication") { if (subcommand === "sendinactivityapplication") {
const channel = interaction.options.getChannel("channel") as TextChannel title = "Inactivity Log"
description = "You can send an inactivity log by clicking the button below."
await channel.send({ customId = "guildinactivitylog"
embeds: [ label = "Submit"
{ emoji = "✅"
title: "Inactivity Log",
description:
"You can send an inactivity log by clicking the button below.",
color: embedColor,
footer: {
text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL({
forceStatic: false,
})!,
},
thumbnail: {
url: interaction.guild!.iconURL({
forceStatic: false,
})!,
},
},
],
components: [
new ActionRowBuilder<ButtonBuilder>().addComponents(
new ButtonBuilder()
.setCustomId("guildinactivitylog")
.setLabel("Submit")
.setStyle(ButtonStyle.Primary)
.setEmoji({ name: "✅" }),
),
],
})
await interaction.reply({
content: "Message sent",
ephemeral: true,
})
} }
if (subcommand === "sendverfiymessage") { if (subcommand === "sendverfiymessage") {
const channel = interaction.options.getChannel("channel") as TextChannel title = "Verification"
description = "You can verify by clicking the button below."
await channel.send({ customId = "verify"
embeds: [ label = "Verify"
{ emoji = "✅"
title: "Verification",
description:
"You can verify by clicking the button below.",
color: embedColor,
footer: {
text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL({
forceStatic: false,
})!,
},
thumbnail: {
url: interaction.guild!.iconURL({
forceStatic: false,
})!,
},
},
],
components: [
new ActionRowBuilder<ButtonBuilder>().addComponents(
new ButtonBuilder()
.setCustomId("verify")
.setLabel("Verify")
.setStyle(ButtonStyle.Primary)
.setEmoji({ name: "✅" }),
),
],
})
await interaction.reply({
content: "Message sent",
ephemeral: true,
})
} }
if (subcommand === "sendwaitinglistmessage") { if (subcommand === "sendwaitinglistmessage") {
const channel = interaction.options.getChannel("channel") as TextChannel title = "Waiting List"
description = "The people below were accepted into the guild\n" + "Try to invite them in order.",
await channel.send({ customId = "waitinglistupdate"
embeds: [ label = "Update"
{ emoji = "🔄"
title: "Waiting List",
description:
"The people below were accepted into the guild\n" +
"Try to invite them in order.",
color: embedColor,
footer: {
text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL({
forceStatic: false,
})!,
},
thumbnail: {
url: interaction.guild!.iconURL({
forceStatic: false,
})!,
},
},
],
components: [
new ActionRowBuilder<ButtonBuilder>().addComponents(
new ButtonBuilder()
.setCustomId("waitinglistupdate")
.setLabel("Update")
.setStyle(ButtonStyle.Primary)
.setEmoji({ name: "🔄" }),
),
],
})
await interaction.reply({
content: "Message sent",
ephemeral: true,
})
} }
await channel.send({
embeds: [{
title: title,
description: description,
color: embedColor,
thumbnail: {
url: interaction.guild!.iconURL({ forceStatic: false }) || "",
},
footer: {
text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL({ forceStatic: false }) || undefined,
}
}],
components: [
new ActionRowBuilder<ButtonBuilder>().addComponents(
new ButtonBuilder()
.setCustomId(customId)
.setLabel(label)
.setStyle(ButtonStyle.Primary)
.setEmoji({ name: emoji })
)
]
})
await interaction.reply({
content: "Message sent",
ephemeral: true,
})
}, },
} as Command } as Command

View File

@@ -61,21 +61,14 @@ export = {
return return
} }
const footerText = interaction.guild
? interaction.guild.name
: interaction.user.username
const footerIcon = interaction.guild
? interaction.guild.iconURL({ forceStatic: false })
: interaction.user.avatarURL({ forceStatic: false })
await interaction.reply({ await interaction.reply({
embeds: [ embeds: [
{ {
description: "This command is currently under development", description: "This command is currently under development",
color: embedColor, color: embedColor,
footer: { footer: {
text: footerText + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: footerIcon!, icon_url: interaction.guild!.iconURL({ forceStatic: false }) || undefined,
}, },
}, },
], ],

View File

@@ -118,53 +118,26 @@ const command: Command = {
return return
} }
let title: string = ""
let description: string = ""
let timeouttime: number | null = 0
if (target.isCommunicationDisabled()) { if (target.isCommunicationDisabled()) {
if (time === 0) { if (time === 0) {
await target.timeout(null, reason) title = "Timeout Removed"
await interaction.editReply({ description = "Removed timeout of " + userMention(target.id) + " for " + reason,
embeds: [ timeouttime = null
{ } else {
description: title = "Timeout Updated"
"Removed timeout of " + description = "Updated timeout of " + userMention(target.id) + " to " + prettyTime + " for " + reason,
userMention(target.id) + timeouttime = time
" for " +
reason,
color: embedColor,
footer: {
text: "ID: " + target.id,
icon_url: target.avatarURL() || undefined,
},
timestamp: new Date().toISOString(),
},
],
})
return
} }
} else {
await target.timeout(time, reason) title = "Member Timed Out"
await interaction.editReply({ description = "Timed out " + userMention(target.id) + " for " + prettyTime + " for " + reason,
embeds: [ timeouttime = time
{
description:
"Updated timeout of " +
userMention(target.id) +
" to " +
prettyTime +
" for " +
reason,
color: embedColor,
footer: {
text: "ID: " + target.id,
icon_url: target.avatarURL() || undefined,
},
timestamp: new Date().toISOString(),
},
],
})
return
} }
await target.timeout(time, reason) await target.timeout(timeouttime, reason)
await logToChannel("mod", { await logToChannel("mod", {
embeds: [{ embeds: [{
@@ -172,11 +145,11 @@ const command: Command = {
name: mod.user.username, name: mod.user.username,
icon_url: mod.user.avatarURL({ forceStatic: false }) || undefined, icon_url: mod.user.avatarURL({ forceStatic: false }) || undefined,
}, },
title: "Member Timed Out", title: title,
description: ` description: `
**User:** ${userMention(target.id)} **User:** ${userMention(target.id)}
**Time:** ${prettyTime} ${timeouttime === null ? "**Time:** `None`" : "**Time:** `" + prettyTime + "`"}
**Reason:** ${reason} **Reason:** \`${reason}\`
**Mod:** ${userMention(mod.id)} **Mod:** ${userMention(mod.id)}
`, `,
color: embedColor, color: embedColor,
@@ -194,10 +167,7 @@ const command: Command = {
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [
{ {
description: description: description,
"Timed out " + userMention(target.id) +
" for " + prettyTime +
" for " + reason,
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,

View File

@@ -76,7 +76,7 @@ export = {
{ {
author: { author: {
name: mod.username, name: mod.username,
icon_url: mod.avatarURL({ forceStatic: false })!, icon_url: mod.avatarURL({ forceStatic: false }) || undefined,
}, },
title: "Member Unbanned", title: "Member Unbanned",
description: ` description: `
@@ -86,7 +86,7 @@ export = {
`, `,
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: mod.avatarURL({ forceStatic: false })!, url: mod.avatarURL({ forceStatic: false }) || "",
}, },
footer: { footer: {
text: "ID: " + user!.id, text: "ID: " + user!.id,
@@ -110,9 +110,7 @@ export = {
url: user!.avatarURL({ forceStatic: false }) || "", url: user!.avatarURL({ forceStatic: false }) || "",
}, },
footer: { footer: {
icon_url: interaction.guild!.iconURL({ icon_url: interaction.guild!.iconURL({ forceStatic: false, }) || undefined,
forceStatic: false,
})!,
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
}, },
}, },

View File

@@ -89,9 +89,8 @@ export = {
if (guildID === hypixelGuildID) { if (guildID === hypixelGuildID) {
const GuildMembers = guild!.members const GuildMembers = guild!.members
const guildRank = GuildMembers.find( const guildRank = GuildMembers.find( member => member.uuid === verifyData.uuid)!.rank
member => member.uuid === verifyData.uuid, let replyRank: string | null = null
)!.rank
await user.roles.add(roleManage("default").rolesToAdd, "User used the update command") await user.roles.add(roleManage("default").rolesToAdd, "User used the update command")
@@ -99,175 +98,59 @@ export = {
const roles = roleManage("gm") const roles = roleManage("gm")
await user.roles.remove(roles.rolesToRemove, "User used the update command") await user.roles.remove(roles.rolesToRemove, "User used the update command")
await user.roles.add(roles.rolesToAdd, "User used the update command") await user.roles.add(roles.rolesToAdd, "User used the update command")
replyRank = "Guild Master"
await interaction.editReply({
embeds: [
{
description:
"Your rank has been updated to `Guild Master`",
color: embedColor,
thumbnail: {
url: head!,
},
footer: {
text:
interaction.guild!.name +
" | " +
devMessage,
icon_url: interaction.guild!.iconURL({
forceStatic: false,
})!,
},
},
],
})
return
} }
if (guildRank === "Manager") { if (guildRank === "Manager") {
const roles = roleManage("manager") const roles = roleManage("manager")
await user.roles.remove(roles.rolesToRemove, "User used the update command") await user.roles.remove(roles.rolesToRemove, "User used the update command")
await user.roles.add(roles.rolesToAdd, "User used the update command") await user.roles.add(roles.rolesToAdd, "User used the update command")
replyRank = "Manager"
await interaction.editReply({
embeds: [
{
description:
"Your rank has been updated to `Manager`",
color: embedColor,
thumbnail: {
url: head!,
},
footer: {
text:
interaction.guild!.name +
" | " +
devMessage,
icon_url: interaction.guild!.iconURL({
forceStatic: false,
})!,
},
},
],
})
return
} }
if (guildRank === "Moderator") { if (guildRank === "Moderator") {
const roles = roleManage("moderator") const roles = roleManage("moderator")
await user.roles.remove(roles.rolesToRemove, "User used the update command") await user.roles.remove(roles.rolesToRemove, "User used the update command")
await user.roles.add(roles.rolesToAdd, "User used the update command") await user.roles.add(roles.rolesToAdd, "User used the update command")
replyRank = "Moderator"
await interaction.editReply({
embeds: [
{
description:
"Your rank has been updated to `Moderator`",
color: embedColor,
thumbnail: {
url: head!,
},
footer: {
text:
interaction.guild!.name +
" | " +
devMessage,
icon_url: interaction.guild!.iconURL({
forceStatic: false,
})!,
},
},
],
})
return
} }
if (guildRank === "Beast") { if (guildRank === "Beast") {
const roles = roleManage("beast") const roles = roleManage("beast")
await user.roles.remove(roles.rolesToRemove, "User used the update command") await user.roles.remove(roles.rolesToRemove, "User used the update command")
await user.roles.add(roles.rolesToAdd, "User used the update command") await user.roles.add(roles.rolesToAdd, "User used the update command")
replyRank = "Beast"
await interaction.editReply({
embeds: [
{
description:
"Your rank has been updated to `Beast`.",
color: embedColor,
thumbnail: {
url: head!,
},
footer: {
text:
interaction.guild!.name +
" | " +
devMessage,
icon_url: interaction.guild!.iconURL({
forceStatic: false,
})!,
},
},
],
})
return
} }
if (guildRank === "Elite") { if (guildRank === "Elite") {
const roles = roleManage("elite") const roles = roleManage("elite")
await user.roles.remove(roles.rolesToRemove, "User used the update command") await user.roles.remove(roles.rolesToRemove, "User used the update command")
await user.roles.add(roles.rolesToAdd, "User used the update command") await user.roles.add(roles.rolesToAdd, "User used the update command")
replyRank = "Elite"
await interaction.editReply({
embeds: [
{
description:
"Your rank has been updated to `Elite`.",
color: embedColor,
thumbnail: {
url: head!,
},
footer: {
text:
interaction.guild!.name +
" | " +
devMessage,
icon_url: interaction.guild!.iconURL({
forceStatic: false,
})!,
},
},
],
})
return
} }
if (guildRank === "Member") { if (guildRank === "Member") {
const roles = roleManage("member") const roles = roleManage("member")
await user.roles.remove(roles.rolesToRemove, "User used the update command") await user.roles.remove(roles.rolesToRemove, "User used the update command")
await user.roles.add(roles.rolesToAdd, "User used the update command") await user.roles.add(roles.rolesToAdd, "User used the update command")
replyRank = "Member"
await interaction.editReply({
embeds: [
{
description:
"Your rank has been updated to `Member`.",
color: embedColor,
thumbnail: {
url: head!,
},
footer: {
text:
interaction.guild!.name +
" | " +
devMessage,
icon_url: interaction.guild!.iconURL({
forceStatic: false,
})!,
},
},
],
})
return
} }
await interaction.editReply({
embeds: [
{
description: "Updated your roles to `" + replyRank + "`",
color: embedColor,
thumbnail: {
url: head!,
},
footer: {
text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL({ forceStatic: false, }) || undefined,
},
},
],
})
} }
}, },
} as Command } as Command

View File

@@ -60,10 +60,7 @@ export = {
}, },
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: icon_url: interaction.guild!.iconURL({ forceStatic: false, }) || undefined,
interaction.guild?.iconURL({
forceStatic: false,
}) || undefined,
}, },
}, },
], ],

View File

@@ -233,7 +233,7 @@ export = {
"`.", "`.",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: head || "", url: head!,
}, },
footer: { footer: {
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined,

View File

@@ -54,9 +54,7 @@ export = {
}, },
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL({ icon_url: interaction.guild!.iconURL({ forceStatic: true, }) || undefined,
forceStatic: true,
})!,
}, },
}, },
], ],