Finalizing staff applicaiotns
This commit is contained in:
@@ -16,15 +16,15 @@
|
|||||||
"rq7": "How did you find about us?",
|
"rq7": "How did you find about us?",
|
||||||
"rq8": "What is your time zone?",
|
"rq8": "What is your time zone?",
|
||||||
"sq1": "What is your IGN?",
|
"sq1": "What is your IGN?",
|
||||||
"sq2": "",
|
"sq2": "How long have you been in the guild for?",
|
||||||
"sq3": "",
|
"sq3": "Have you been guild muted for any reason? (This includes mutes for staff disrespect, arguing with guild members, toxicity...)",
|
||||||
"sq4": "",
|
"sq4": "Are you an active guild member? (Keep in mind we will surely check your GEXP)",
|
||||||
"sq5": "",
|
"sq5": "Do you have any experience as a staff member (guild moderator) at all?",
|
||||||
"sq6": "",
|
"sq6": "Why should we choose you as a Guild Moderator? (Tell us what would you do for the guild, how are you gonna help us grow the community, how many hours per day are you willing to spend doing the stuff as moderator for the guild etc..",
|
||||||
"rsq1": "",
|
"rsq1": "What is your IGN?",
|
||||||
"rsq2": "",
|
"rsq2": "How long have you been in the guild for?",
|
||||||
"rsq3": "",
|
"rsq3": "Have you been guild muted for any reason?",
|
||||||
"rsq4": "",
|
"rsq4": "Are you an active guild member?",
|
||||||
"rsq5": "",
|
"rsq5": "Do you have any experience as a staff member (guild moderator) at all?",
|
||||||
"rsq6": ""
|
"rsq6": "Why should we choose you as a Guild Moderator?"
|
||||||
}
|
}
|
||||||
@@ -20,6 +20,7 @@ module.exports = {
|
|||||||
const applicantId = embed.footer.text.split(" ")[1]
|
const applicantId = embed.footer.text.split(" ")[1]
|
||||||
|
|
||||||
const applicant = await guild.members.fetch(applicantId)
|
const applicant = await guild.members.fetch(applicantId)
|
||||||
|
const applicantUsername = applicant.user.username + "#" + applicant.user.discriminator;
|
||||||
|
|
||||||
await applicant.send({
|
await applicant.send({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
@@ -35,9 +36,7 @@ module.exports = {
|
|||||||
.setCustomId("staffapplicationaccept")
|
.setCustomId("staffapplicationaccept")
|
||||||
.setLabel("Accept")
|
.setLabel("Accept")
|
||||||
.setStyle(ButtonStyle.Primary)
|
.setStyle(ButtonStyle.Primary)
|
||||||
.setDisabled(true)
|
.setDisabled(true),
|
||||||
),
|
|
||||||
new ActionRowBuilder().addComponents(
|
|
||||||
new ButtonBuilder()
|
new ButtonBuilder()
|
||||||
.setCustomId("staffapplicationdeny")
|
.setCustomId("staffapplicationdeny")
|
||||||
.setLabel("Deny")
|
.setLabel("Deny")
|
||||||
@@ -52,9 +51,7 @@ module.exports = {
|
|||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: applicantUsername + " - Staff Application.",
|
title: applicantUsername + " - Staff Application.",
|
||||||
description: "Application accepted by <@" + user.id + ">.\n\n" +
|
description: "Application accepted by <@" + user.id + ">.",
|
||||||
"Press the button below to delete this channel.\n" +
|
|
||||||
"**When the user was given their role**",
|
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: applicant.avatarURL()
|
url: applicant.avatarURL()
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ module.exports = {
|
|||||||
const question2 = await user.send({
|
const question2 = await user.send({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title : "**Question 2**",
|
title : "**Question 2**",
|
||||||
description: sq2 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n" + "`(8 characters max)`",
|
description: sq2 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n" + "`(64 characters max)`",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
footer:{
|
footer:{
|
||||||
text: "You have 15 minutes to respond to this message."
|
text: "You have 15 minutes to respond to this message."
|
||||||
@@ -160,10 +160,10 @@ module.exports = {
|
|||||||
await user.send({ embeds: [attachments] });
|
await user.send({ embeds: [attachments] });
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (answer2.first().content > 8) {
|
if (answer2.first().content > 64) {
|
||||||
await user.send({
|
await user.send({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "Max character limit is 8.",
|
description: "Max character limit is 64.",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
@@ -183,7 +183,7 @@ module.exports = {
|
|||||||
const question3 = await user.send({
|
const question3 = await user.send({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title : "**Question 3**",
|
title : "**Question 3**",
|
||||||
description: sq3 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + smallM + "`",
|
description: sq3 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
footer:{
|
footer:{
|
||||||
text: "You have 15 minutes to respond to this message."
|
text: "You have 15 minutes to respond to this message."
|
||||||
@@ -199,10 +199,10 @@ module.exports = {
|
|||||||
await user.send({ embeds: [attachments] });
|
await user.send({ embeds: [attachments] });
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (answer3.first().content > 128) {
|
if (answer3.first().content > 256) {
|
||||||
await user.send({
|
await user.send({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "Max character limit is 128.",
|
description: "Max character limit is 256.",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
@@ -221,8 +221,7 @@ module.exports = {
|
|||||||
const question4 = await user.send({
|
const question4 = await user.send({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title : "**Question 4**",
|
title : "**Question 4**",
|
||||||
description: sq4 + "\n\nPlease type your answer below or type `cancel` to cancel your application." +
|
description: sq4 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
|
||||||
" `(We expect a longer answer.)`\n`" + largeM + "`",
|
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
footer:{
|
footer:{
|
||||||
text: "You have 15 minutes to respond to this message."
|
text: "You have 15 minutes to respond to this message."
|
||||||
@@ -260,7 +259,7 @@ module.exports = {
|
|||||||
const question5 = await user.send({
|
const question5 = await user.send({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title : "**Question 5**",
|
title : "**Question 5**",
|
||||||
description: sq5 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + smallM + "`",
|
description: sq5 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
footer:{
|
footer:{
|
||||||
text: "You have 15 minutes to respond to this message."
|
text: "You have 15 minutes to respond to this message."
|
||||||
@@ -276,10 +275,10 @@ module.exports = {
|
|||||||
await user.send({ embeds: [attachments] });
|
await user.send({ embeds: [attachments] });
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (answer5.first().content > 128) {
|
if (answer5.first().content > 256) {
|
||||||
await user.send({
|
await user.send({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "Max character limit is 128.",
|
description: "Max character limit is 256.",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
@@ -298,7 +297,8 @@ module.exports = {
|
|||||||
const question6 = await user.send({
|
const question6 = await user.send({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title : "**Question 6**",
|
title : "**Question 6**",
|
||||||
description: sq6 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
|
description: sq6 + "\n\nPlease type your answer below or type `cancel` to cancel your application." +
|
||||||
|
"`(We expect a longer answer here)`\n`" + largeM + "`",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
footer:{
|
footer:{
|
||||||
text: "You have 15 minutes to respond to this message."
|
text: "You have 15 minutes to respond to this message."
|
||||||
@@ -364,11 +364,16 @@ module.exports = {
|
|||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const userCheck = await fetch(mojangAPI + answer1_1)
|
||||||
|
const uuid = userCheck.data.id
|
||||||
|
|
||||||
const newStaffApp = new staffapp({
|
const newStaffApp = new staffapp({
|
||||||
_id: new mongoose.Types.ObjectId(),
|
_id: new mongoose.Types.ObjectId(),
|
||||||
userID: user.id,
|
userID: user.id,
|
||||||
|
uuid: uuid,
|
||||||
})
|
})
|
||||||
newStaffApp.save()
|
|
||||||
|
await newStaffApp.save()
|
||||||
await user.deleteDM();
|
await user.deleteDM();
|
||||||
|
|
||||||
const channel = guild.channels.cache.get(staffApplicationsChannel);
|
const channel = guild.channels.cache.get(staffApplicationsChannel);
|
||||||
@@ -417,9 +422,7 @@ module.exports = {
|
|||||||
new ButtonBuilder()
|
new ButtonBuilder()
|
||||||
.setCustomId("staffapplicationaccept")
|
.setCustomId("staffapplicationaccept")
|
||||||
.setLabel("Accept")
|
.setLabel("Accept")
|
||||||
.setStyle(ButtonStyle.Primary)
|
.setStyle(ButtonStyle.Primary),
|
||||||
),
|
|
||||||
new ActionRowBuilder().addComponents(
|
|
||||||
new ButtonBuilder()
|
new ButtonBuilder()
|
||||||
.setCustomId("staffapplicationdeny")
|
.setCustomId("staffapplicationdeny")
|
||||||
.setLabel("Deny")
|
.setLabel("Deny")
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
const { InteractionType, EmbedBuilder } = require('discord.js');
|
const { InteractionType, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');
|
||||||
const { color } = require('../../config/options.json');
|
const { color } = require('../../config/options.json');
|
||||||
|
const mongoose = require('mongoose');
|
||||||
|
const staffapp = require('../../schemas/staffAppSchema.js');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
@@ -25,6 +27,23 @@ module.exports = {
|
|||||||
const applicantId = embed.footer.text.split(" ")[1]
|
const applicantId = embed.footer.text.split(" ")[1]
|
||||||
const applicant = await guild.members.fetch(applicantId)
|
const applicant = await guild.members.fetch(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),
|
||||||
|
)
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
const dmMessage = new EmbedBuilder()
|
const dmMessage = new EmbedBuilder()
|
||||||
.setDescription("Your application for the Illegitimate guild staff has been denied\n" +
|
.setDescription("Your application for the Illegitimate guild staff has been denied\n" +
|
||||||
"**Reason:** `" + reason + "`")
|
"**Reason:** `" + reason + "`")
|
||||||
@@ -32,6 +51,8 @@ module.exports = {
|
|||||||
|
|
||||||
await applicant.send({ embeds: [dmMessage] });
|
await applicant.send({ embeds: [dmMessage] });
|
||||||
|
|
||||||
|
await staffapp.findOneAndDelete({ userID: applicantId });
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: "Application Denied",
|
title: "Application Denied",
|
||||||
|
|||||||
Reference in New Issue
Block a user