Fixed formatting on button files
This commit is contained in:
@@ -1,11 +1,4 @@
|
||||
import {
|
||||
ButtonBuilder,
|
||||
ButtonStyle,
|
||||
ActionRowBuilder,
|
||||
EmbedBuilder,
|
||||
GuildMember,
|
||||
TextChannel
|
||||
} from "discord.js"
|
||||
import { ButtonBuilder, ButtonStyle, ActionRowBuilder, EmbedBuilder, GuildMember, TextChannel } from "discord.js"
|
||||
import { color, staffApplicationsChannel } from "config/options.json"
|
||||
import { largeM, ignM } from "config/limitmessages.json"
|
||||
import questions from "config/questions.json"
|
||||
@@ -43,17 +36,13 @@ export = {
|
||||
|
||||
if (user.user.id !== env.prod.dev) {
|
||||
if (status === "0") {
|
||||
await interaction.editReply(
|
||||
"Staff applications are currently closed."
|
||||
)
|
||||
await interaction.editReply("Staff applications are currently closed.")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if (!userRoles.has(guildRole)) {
|
||||
await interaction.editReply(
|
||||
"You must be a member of the guild to apply for staff."
|
||||
)
|
||||
await interaction.editReply("You must be a member of the guild to apply for staff.")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -65,9 +54,7 @@ export = {
|
||||
const application = await staffapp.findOne({ userID: user.user.id })
|
||||
|
||||
if (application) {
|
||||
await interaction.editReply(
|
||||
"You already have an application in progress."
|
||||
)
|
||||
await interaction.editReply("You already have an application in progress.")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -78,23 +65,18 @@ export = {
|
||||
.setDescription("You have cancelled your application.")
|
||||
.setColor(embedColor)
|
||||
const attachments = new EmbedBuilder()
|
||||
.setDescription(
|
||||
"You have uploaded an attachment. Please do not upload images, videos, or GIFS."
|
||||
)
|
||||
.setDescription("You have uploaded an attachment. Please do not upload images, videos, or GIFS.")
|
||||
.setColor(embedColor)
|
||||
|
||||
try {
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
title: "Staff Application",
|
||||
description:
|
||||
"If you wish to proceed with your application, please type `yes` otherwise type `cancel`.\n\n" +
|
||||
"**Do not upload images, videos, or GIFS.**\n" +
|
||||
"You have a minute to respond to this message.",
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
embeds: [{
|
||||
title: "Staff Application",
|
||||
description: "If you wish to proceed with your application, please type `yes` otherwise type `cancel`.\n\n" +
|
||||
"**Do not upload images, videos, or GIFS.**\n" +
|
||||
"You have a minute to respond to this message.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
} catch (error) {
|
||||
await interaction.editReply("Please enable your DMs.")
|
||||
@@ -123,20 +105,14 @@ export = {
|
||||
|
||||
// first question
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 1**",
|
||||
description:
|
||||
sq(1) +
|
||||
"\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" +
|
||||
ignM +
|
||||
"`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 5 minutes to respond to this message."
|
||||
}
|
||||
embeds: [{
|
||||
title: "**Question 1**",
|
||||
description: sq(1) + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + ignM + "`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 5 minutes to respond to this message."
|
||||
}
|
||||
]
|
||||
}]
|
||||
})
|
||||
const answer1 = await user.dmChannel!.awaitMessages({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
@@ -157,26 +133,21 @@ export = {
|
||||
}
|
||||
if (answer1.first()!.content.length > 16) {
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 16.",
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
embeds: [{
|
||||
description: "Max character limit is 16.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
const uuid = await getUUID(answer1.first()!.content)
|
||||
if (!uuid) {
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"That is not a valid Minecraft username.\n" +
|
||||
"Application cancelled.",
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
embeds: [{
|
||||
description: "That is not a valid Minecraft username.\n" +
|
||||
"Application cancelled.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -184,19 +155,15 @@ export = {
|
||||
|
||||
// second question
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 2**",
|
||||
description:
|
||||
sq(2) +
|
||||
"\n\nPlease type your answer below or type `cancel` to cancel your application.\n" +
|
||||
"`(64 characters max)`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
embeds: [{
|
||||
title: "**Question 2**",
|
||||
description: sq(2) + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n" +
|
||||
"`(64 characters max)`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
]
|
||||
}]
|
||||
})
|
||||
const answer2 = await user.dmChannel!.awaitMessages({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
@@ -217,12 +184,10 @@ export = {
|
||||
}
|
||||
if (answer2.first()!.content.length > 64) {
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 64.",
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
embeds: [{
|
||||
description: "Max character limit is 64.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -230,20 +195,14 @@ export = {
|
||||
|
||||
// third question
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 3**",
|
||||
description:
|
||||
sq(3) +
|
||||
"\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" +
|
||||
largeM +
|
||||
"`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
embeds: [{
|
||||
title: "**Question 3**",
|
||||
description: sq(3) + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
]
|
||||
}]
|
||||
})
|
||||
const answer3 = await user.dmChannel!.awaitMessages({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
@@ -264,32 +223,24 @@ export = {
|
||||
}
|
||||
if (answer3.first()!.content.length > 256) {
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
embeds: [{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
}
|
||||
const answer3_1 = answer3.first()!.content
|
||||
|
||||
// fourth question
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 4**",
|
||||
description:
|
||||
sq(4) +
|
||||
"\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" +
|
||||
largeM +
|
||||
"`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
embeds: [{
|
||||
title: "**Question 4**",
|
||||
description: sq(4) + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
]
|
||||
}]
|
||||
})
|
||||
const answer4 = await user.dmChannel!.awaitMessages({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
@@ -310,32 +261,24 @@ export = {
|
||||
}
|
||||
if (answer4.first()!.content.length > 256) {
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
embeds: [{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
}
|
||||
const answer4_1 = answer4.first()!.content
|
||||
|
||||
// fifth question
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 5**",
|
||||
description:
|
||||
sq(5) +
|
||||
"\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" +
|
||||
largeM +
|
||||
"`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
embeds: [{
|
||||
title: "**Question 5**",
|
||||
description: sq(5) + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
]
|
||||
}]
|
||||
})
|
||||
const answer5 = await user.dmChannel!.awaitMessages({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
@@ -356,33 +299,25 @@ export = {
|
||||
}
|
||||
if (answer5.first()!.content.length > 256) {
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
embeds: [{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
}
|
||||
const answer5_1 = answer5.first()!.content
|
||||
|
||||
// sixth question
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 6**",
|
||||
description:
|
||||
sq(6) +
|
||||
"\n\nPlease type your answer below or type `cancel` to cancel your application." +
|
||||
"`(We expect a longer answer here)`\n`" +
|
||||
largeM +
|
||||
"`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
embeds: [{
|
||||
title: "**Question 6**",
|
||||
description: sq(6) + "\n\nPlease type your answer below or type `cancel` to cancel your application." +
|
||||
"`(We expect a longer answer here)`\n`" + largeM + "`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
]
|
||||
}]
|
||||
})
|
||||
const answer6 = await user.dmChannel!.awaitMessages({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
@@ -403,24 +338,19 @@ export = {
|
||||
}
|
||||
if (answer6.first()!.content.length > 256) {
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
embeds: [{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
}
|
||||
const answer6_1 = answer6.first()!.content
|
||||
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"If you want to submit your application, type `yes` if not, type `no`",
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
embeds: [{
|
||||
description: "If you want to submit your application, type `yes` if not, type `no`",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
|
||||
const final = await user.dmChannel!.awaitMessages({
|
||||
@@ -442,12 +372,10 @@ export = {
|
||||
}
|
||||
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
description: "Your application has been submitted!",
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
embeds: [{
|
||||
description: "Your application has been submitted!",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
|
||||
const newStaffApp = new staffapp({
|
||||
@@ -459,54 +387,46 @@ export = {
|
||||
await newStaffApp.save()
|
||||
await user.deleteDM()
|
||||
|
||||
const channel = guild.channels.cache.get(
|
||||
staffApplicationsChannel
|
||||
) as TextChannel
|
||||
const channel = guild.channels.cache.get(staffApplicationsChannel) as TextChannel
|
||||
|
||||
await channel.send({
|
||||
embeds: [
|
||||
{
|
||||
title:
|
||||
user.user.username +
|
||||
"#" +
|
||||
user.user.discriminator +
|
||||
" - Staff Application",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: user.avatarURL() || ""
|
||||
embeds: [{
|
||||
title: user.user.username + "#" + user.user.discriminator + " - Staff Application",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: user.avatarURL() || ""
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: rq(1),
|
||||
value: "```" + answer1_1 + "```"
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: rq(1),
|
||||
value: "```" + answer1_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(2),
|
||||
value: "```" + answer2_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(3),
|
||||
value: "```" + answer3_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(4),
|
||||
value: "```" + answer4_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(5),
|
||||
value: "```" + answer5_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(6),
|
||||
value: "```" + answer6_1 + "```"
|
||||
}
|
||||
],
|
||||
footer: {
|
||||
icon_url: guild.iconURL() || undefined,
|
||||
text: "ID: " + user.user.id
|
||||
{
|
||||
name: rq(2),
|
||||
value: "```" + answer2_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(3),
|
||||
value: "```" + answer3_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(4),
|
||||
value: "```" + answer4_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(5),
|
||||
value: "```" + answer5_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(6),
|
||||
value: "```" + answer6_1 + "```"
|
||||
}
|
||||
],
|
||||
footer: {
|
||||
icon_url: guild.iconURL() || undefined,
|
||||
text: "ID: " + user.user.id
|
||||
}
|
||||
],
|
||||
}],
|
||||
components: [
|
||||
new ActionRowBuilder<ButtonBuilder>().addComponents(
|
||||
new ButtonBuilder()
|
||||
|
||||
Reference in New Issue
Block a user