@@ -1,21 +1,22 @@
|
||||
const { InteractionType, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require("discord.js");
|
||||
const { color } = require("../../config/options.json");
|
||||
const mongoose = require("mongoose");
|
||||
const guildapp = require("../../schemas/guildAppSchema.js");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const { InteractionType, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');
|
||||
const { color } = require('../../config/options.json');
|
||||
const mongoose = require('mongoose');
|
||||
const guildapp = require('../../schemas/guildAppSchema.js');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
name: "denyreasonbox",
|
||||
description: "Deny reason box.",
|
||||
type: "modal",
|
||||
name: 'denyreasonbox',
|
||||
description: 'Deny reason box.',
|
||||
type: 'modal',
|
||||
|
||||
async execute(interaction) {
|
||||
|
||||
if (interaction.type !== InteractionType.ModalSubmit) return;
|
||||
if (interaction.customId !== "denyreasonbox") return;
|
||||
|
||||
|
||||
interaction.deferReply();
|
||||
|
||||
|
||||
const guild = interaction.guild;
|
||||
|
||||
const message = interaction.message;
|
||||
@@ -23,7 +24,7 @@ module.exports = {
|
||||
const applicantId = embed.footer.text.split(" ")[1];
|
||||
|
||||
const applicant = await guild.members.fetch(applicantId);
|
||||
const reason = interaction.fields.fields.get("denyreason").value || "No reason provided";
|
||||
const reason = interaction.fields.fields.get('denyreason').value || "No reason provided";
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
const filePath = path.join(__dirname, `../../apps/guild/${applicantId}`);
|
||||
|
||||
@@ -44,15 +45,14 @@ module.exports = {
|
||||
.setCustomId("checkstats")
|
||||
.setLabel("Check Stats")
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
.setDisabled(true),
|
||||
),
|
||||
],
|
||||
.setDisabled(true)
|
||||
)
|
||||
]
|
||||
});
|
||||
|
||||
const dmMessage = new EmbedBuilder()
|
||||
.setDescription(
|
||||
"Your application for the Illegitimate guild has been denied\n" + "**Reason:** `" + reason + "`",
|
||||
)
|
||||
.setDescription("Your application for the Illegitimate guild has been denied\n" +
|
||||
"**Reason:** `" + reason + "`")
|
||||
.setColor(embedColor);
|
||||
|
||||
await applicant.send({ embeds: [dmMessage] });
|
||||
@@ -60,26 +60,19 @@ module.exports = {
|
||||
await guildapp.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: {
|
||||
iconURL: guild.iconURL(),
|
||||
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: {
|
||||
iconURL: guild.iconURL(),
|
||||
text: "ID: " + applicant.id
|
||||
}
|
||||
}],
|
||||
});
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user