Updated formatting on modals and autocomplete

This commit is contained in:
2024-01-20 17:34:25 +01:00
parent e60523c7b6
commit 631581574c
4 changed files with 60 additions and 146 deletions

View File

@@ -1,9 +1,4 @@
import {
EmbedBuilder,
ActionRowBuilder,
ButtonBuilder,
ButtonStyle
} from "discord.js"
import { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js"
import { color } from "config/options.json"
import staffapp from "schemas/staffAppSchema"
import { Modal } from "interfaces"
@@ -16,9 +11,7 @@ export = {
await interaction.deferReply()
const guild = interaction.guild
const reason =
interaction.fields.fields.get("staffdenyreason")!.value ||
"No reason provided"
const reason = interaction.fields.fields.get("staffdenyreason")!.value || "No reason provided"
const embedColor = Number(color.replace("#", "0x"))
const message = interaction.message!
@@ -44,11 +37,8 @@ export = {
})
const dmMessage = new EmbedBuilder()
.setDescription(
"Your application for the Illegitimate guild staff has been denied\n" +
"**Reason:** `" +
reason +
"`"
.setDescription("Your application for the Illegitimate guild staff has been denied\n" +
"**Reason:** `" + reason + "`"
)
.setColor(embedColor)
@@ -57,26 +47,19 @@ export = {
await staffapp.findOneAndDelete({ userID: applicantId })
await interaction.editReply({
embeds: [
{
title: "Application Denied",
description:
"The application has been denied by <@" +
interaction.user.id +
">.\n" +
"**Reason:** `" +
reason +
"`",
color: embedColor,
thumbnail: {
url: applicant.avatarURL() || ""
},
footer: {
icon_url: guild!.iconURL() || undefined,
text: "ID: " + applicant.id
}
embeds: [{
title: "Application Denied",
description: "The application has been denied by <@" + interaction.user.id + ">.\n" +
"**Reason:** `" + reason + "`",
color: embedColor,
thumbnail: {
url: applicant.avatarURL() || ""
},
footer: {
icon_url: guild!.iconURL() || undefined,
text: "ID: " + applicant.id
}
]
}]
})
}
} as Modal