Revert "Beautifying"

This reverts commit 3a3bb89635
This commit is contained in:
2023-04-24 22:02:52 +00:00
parent 6dbb92241a
commit 510f6afd23
40 changed files with 3329 additions and 3951 deletions

View File

@@ -1,69 +1,66 @@
const { ActionRowBuilder, ButtonBuilder, ButtonStyle } = require("discord.js");
const { color } = require("../../config/options.json");
const staffapp = require("../../schemas/staffAppSchema.js");
const { ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');
const { color } = require('../../config/options.json');
const staffapp = require('../../schemas/staffAppSchema.js');
module.exports = {
name: "staffapplicationaccept",
description: "Accept a staff application.",
type: "button",
name: 'staffapplicationaccept',
description: 'Accept a staff application.',
type: 'button',
async execute(interaction) {
const user = interaction.user;
const channel = interaction.channel;
const guild = interaction.guild;
const embedColor = Number(color.replace("#", "0x"));
async execute(interaction) {
const message = interaction.message;
const embed = message.embeds[0];
const applicantId = embed.footer.text.split(" ")[1];
const user = interaction.user;
const channel = interaction.channel;
const guild = interaction.guild;
const embedColor = Number(color.replace("#", "0x"));
const applicant = await guild.members.fetch(applicantId);
const applicantUsername =
applicant.user.username + "#" + applicant.user.discriminator;
const message = interaction.message;
const embed = message.embeds[0];
const applicantId = embed.footer.text.split(" ")[1]
await applicant.send({
embeds: [
{
description: `Your application for the Illegitimate staff team has been accepted.`,
color: embedColor
}
]
});
const applicant = await guild.members.fetch(applicantId)
const applicantUsername = applicant.user.username + "#" + applicant.user.discriminator;
await message.edit({
components: [
new ActionRowBuilder().addComponents(
new ButtonBuilder()
.setCustomId("staffapplicationaccept")
.setLabel("Accept")
.setStyle(ButtonStyle.Primary)
.setDisabled(true),
new ButtonBuilder()
.setCustomId("staffapplicationdeny")
.setLabel("Deny")
.setStyle(ButtonStyle.Danger)
.setDisabled(true)
)
]
});
await applicant.send({
embeds: [{
description: `Your application for the Illegitimate staff team has been accepted.`,
color: embedColor
}]
});
await staffapp.findOneAndDelete({ userId: applicantId });
await message.edit({
components: [
new ActionRowBuilder().addComponents(
new ButtonBuilder()
.setCustomId("staffapplicationaccept")
.setLabel("Accept")
.setStyle(ButtonStyle.Primary)
.setDisabled(true),
new ButtonBuilder()
.setCustomId("staffapplicationdeny")
.setLabel("Deny")
.setStyle(ButtonStyle.Danger)
.setDisabled(true)
)
]
});
await interaction.reply({
embeds: [
{
title: applicantUsername + " - Staff Application.",
description: "Application accepted by <@" + user.id + ">.",
color: embedColor,
thumbnail: {
url: applicant.avatarURL()
},
footer: {
iconurl: guild.iconURL(),
text: "ID: " + applicantId
}
}
]
});
}
};
await staffapp.findOneAndDelete({ userId: applicantId });
await interaction.reply({
embeds: [{
title: applicantUsername + " - Staff Application.",
description: "Application accepted by <@" + user.id + ">.",
color: embedColor,
thumbnail: {
url: applicant.avatarURL()
},
footer: {
iconurl: guild.iconURL(),
text: "ID: " + applicantId
}
}]
});
}
}