Fixed formatting on button files

This commit is contained in:
2024-01-20 20:43:12 +01:00
parent 631581574c
commit 5ce69eced3
10 changed files with 802 additions and 1162 deletions

View File

@@ -1,22 +1,7 @@
import { color, devMessage } from "config/options.json" import { color, devMessage } from "config/options.json"
import guildapp from "schemas/guildAppSchema" import guildapp from "schemas/guildAppSchema"
import { import { bwfkdr, bwstars, bwwins, swstars, swkdr, duelswins, duelswlr } from "config/reqs.json"
bwfkdr, import { hypixelLevel, bedwarsLevel, skywarsLevel, getPlayer, getGuild, getHeadURL } from "utils/Hypixel"
bwstars,
bwwins,
swstars,
swkdr,
duelswins,
duelswlr
} from "config/reqs.json"
import {
hypixelLevel,
bedwarsLevel,
skywarsLevel,
getPlayer,
getGuild,
getHeadURL
} from "utils/Hypixel"
import { Button } from "interfaces" import { Button } from "interfaces"
export = { export = {
@@ -36,13 +21,10 @@ export = {
const player = await getPlayer(uuid) const player = await getPlayer(uuid)
if (!player) { if (!player) {
interaction.editReply({ interaction.editReply({
embeds: [ embeds: [{
{ description: "That player hasn't played Hypixel before.",
description:
"That player hasn't played Hypixel before.",
color: embedColor color: embedColor
} }]
]
}) })
return return
} }
@@ -97,138 +79,92 @@ export = {
}) })
} else { } else {
if (player.stats.Bedwars) { if (player.stats.Bedwars) {
const hsbwexp = player.stats?.Bedwars?.Experience || 0 const hsbwexp = player.stats.Bedwars?.Experience || 0
const hsbwfk = player.stats.Bedwars?.final_kills_bedwars || 0
const hsbwfd = player.stats.Bedwars?.final_deaths_bedwars || 0
const hsbwwins = player.stats.Bedwars?.wins_bedwars || 0
const hsbwstars = bedwarsLevel(hsbwexp) const hsbwstars = bedwarsLevel(hsbwexp)
const hsbwfk = player.stats?.Bedwars?.final_kills_bedwars || 0
const hsbwfd = player.stats?.Bedwars?.final_deaths_bedwars || 0
const hsbwfkdr = hsbwfk / hsbwfd || 0 const hsbwfkdr = hsbwfk / hsbwfd || 0
const hsbwwins = player.stats?.Bedwars?.wins_bedwars || 0
let bwtitle = "" let bwtitle = ""
if ( if (hsbwstars < bwstars || hsbwfkdr < bwfkdr || hsbwwins < bwwins) {
hsbwstars < bwstars || bwtitle = "<a:cross_a:1087808606897983539> This player does not meet the BedWars requirements."
hsbwfkdr < bwfkdr ||
hsbwwins < bwwins
) {
bwtitle =
"<a:cross_a:1087808606897983539> This player does not meet the BedWars requirements."
} else { } else {
bwtitle = bwtitle = "<a:check_a:1087808632172847134> This player meets the BedWars requirements."
"<a:check_a:1087808632172847134> This player meets the BedWars requirements."
} }
statsFields.push({ statsFields.push({
name: bwtitle, name: bwtitle,
value: value: "**➺ Stars:** `" + hsbwstars.toFixed(2).toString() +
"**➺ Stars:** `" + " / " + bwstars.toString() + "`\n" +
hsbwstars.toFixed(2).toString() + "**➺ FKDR:** `" + hsbwfkdr.toFixed(2).toString() +
" / " + " / " + bwfkdr.toString() + "`\n" +
bwstars.toString() + "**➺ Wins:** `" + hsbwwins.toString() +
"`\n" + " / " + bwwins.toString() + "`"
"**➺ FKDR:** `" +
hsbwfkdr.toFixed(2).toString() +
" / " +
bwfkdr.toString() +
"`\n" +
"**➺ Wins:** `" +
hsbwwins.toString() +
" / " +
bwwins.toString() +
"`"
}) })
} }
if (player.stats.SkyWars) { if (player.stats.SkyWars) {
const hsswexp = player.stats?.SkyWars?.skywars_experience || 0 const hsswexp = player.stats.SkyWars?.skywars_experience || 0
const hsswkills = player.stats.SkyWars?.kills || 0
const hsswdeaths = player.stats.SkyWars?.deaths || 0
const hsswwins = player.stats.SkyWars?.wins || 0
const hsswstars = skywarsLevel(hsswexp) const hsswstars = skywarsLevel(hsswexp)
const hsswkills = player.stats?.SkyWars?.kills || 0
const hsswdeaths = player.stats?.SkyWars?.deaths || 0
const hsswkd = hsswkills / hsswdeaths const hsswkd = hsswkills / hsswdeaths
const hsswwins = player.stats?.SkyWars?.wins || 0
let swtitle = "" let swtitle = ""
if (hsswstars < swstars || hsswkd < swkdr) { if (hsswstars < swstars || hsswkd < swkdr) {
swtitle = swtitle = "<a:cross_a:1087808606897983539> This player does not meet the SkyWars requirements."
"<a:cross_a:1087808606897983539> This player does not meet the SkyWars requirements."
} else { } else {
swtitle = swtitle = "<a:check_a:1087808632172847134> This player meets the SkyWars requirements."
"<a:check_a:1087808632172847134> This player meets the SkyWars requirements."
} }
statsFields.push({ statsFields.push({
name: swtitle, name: swtitle,
value: value: "**➺ Stars:** `" + hsswstars.toFixed(2).toString() +
"**➺ Stars:** `" + " / " + swstars.toString() + "`\n" +
hsswstars.toFixed(2).toString() + "**➺ KDR:** `" + hsswkd.toFixed(2).toString() +
" / " + " / " + swkdr.toString() + "`\n" +
swstars.toString() + "**➺ Wins:** `" + hsswwins.toString() + "`"
"`\n" +
"**➺ KDR:** `" +
hsswkd.toFixed(2).toString() +
" / " +
swkdr.toString() +
"`\n" +
"**➺ Wins:** `" +
hsswwins.toString() +
"`"
}) })
} }
if (player.stats.Duels) { if (player.stats.Duels) {
const hsduelskills = player.stats?.Duels?.kills || 0 const hsduelskills = player.stats.Duels?.kills || 0
const hsduelsdeaths = player.stats?.Duels?.deaths || 0 const hsduelsdeaths = player.stats.Duels?.deaths || 0
const hsduelswins = player.stats.Duels?.wins || 0
const hsduelslosses = player.stats.Duels?.losses || 0
const hsduelskd = hsduelskills / hsduelsdeaths const hsduelskd = hsduelskills / hsduelsdeaths
const hsduelswins = player.stats?.Duels?.wins || 0
const hsduelslosses = player.stats?.Duels?.losses || 0
const hsduelswlr = hsduelswins / hsduelslosses const hsduelswlr = hsduelswins / hsduelslosses
let duelstitle = "" let duelstitle = ""
if (hsduelswins < duelswins || hsduelswlr < duelswlr) { if (hsduelswins < duelswins || hsduelswlr < duelswlr) {
duelstitle = duelstitle = "<a:cross_a:1087808606897983539> This player does not meet the Duels requirements."
"<a:cross_a:1087808606897983539> This player does not meet the Duels requirements."
} else { } else {
duelstitle = duelstitle = "<a:check_a:1087808632172847134> This player meets the Duels requirements."
"<a:check_a:1087808632172847134> This player meets the Duels requirements."
} }
statsFields.push({ statsFields.push({
name: duelstitle, name: duelstitle,
value: value: "**➺ Wins:** `" + hsduelswins.toString() +
"**➺ Wins:** `" + " / " + duelswins.toString() + "`\n" +
hsduelswins.toString() + "**➺ WLR:** `" + hsduelswlr.toFixed(2).toString() +
" / " + " / " + duelswlr.toString() + "`\n" +
duelswins.toString() + "**➺ KDR:** `" + hsduelskd.toFixed(2).toString() + "`"
"`\n" +
"**➺ WLR:** `" +
hsduelswlr.toFixed(2).toString() +
" / " +
duelswlr.toString() +
"`\n" +
"**➺ KDR:** `" +
hsduelskd.toFixed(2).toString() +
"`"
}) })
} }
} }
// network level // network level
const hypixelExp = player.networkExp || 0 const hypixelExp = player?.networkExp || 0
const level = hypixelLevel(hypixelExp) const level = hypixelLevel(hypixelExp)
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
title: rank + player.displayname + guildTag, title: rank + player.displayname + guildTag,
description: description: "**Network Level:** `" + level.toFixed(2).toString() + "`\n" +
"**Network Level:** `" + "**Current Guild:** `" + guildName + "`\n" +
level.toFixed(2).toString() + "**Guild Rank:** `" + guildRank + "`",
"`\n" +
"**Current Guild:** `" +
guildName +
"`\n" +
"**Guild Rank:** `" +
guildRank +
"`",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: head! url: head!
@@ -238,8 +174,7 @@ export = {
icon_url: interaction.guild!.iconURL() || undefined icon_url: interaction.guild!.iconURL() || undefined
}, },
fields: statsFields fields: statsFields
} }]
]
}) })
} }
} as Button } as Button

View File

@@ -1,15 +1,5 @@
import { import { ActionRowBuilder, ButtonStyle, ButtonBuilder, TextChannel } from "discord.js"
ActionRowBuilder, import { color, waitingListChannel, waitingListMessage, hypixelGuildID } from "config/options.json"
ButtonStyle,
ButtonBuilder,
TextChannel
} from "discord.js"
import {
color,
waitingListChannel,
waitingListMessage,
hypixelGuildID
} from "config/options.json"
import colorLog from "utils/functions/colors" import colorLog from "utils/functions/colors"
import mongoose from "mongoose" import mongoose from "mongoose"
import guildapp from "schemas/guildAppSchema" import guildapp from "schemas/guildAppSchema"
@@ -35,8 +25,7 @@ export = {
const applicantIGN = embed.fields[0].value.replaceAll("`", "") const applicantIGN = embed.fields[0].value.replaceAll("`", "")
const applicant = await guild.members.fetch(applicantId) const applicant = await guild.members.fetch(applicantId)
const applicantUsername = const applicantUsername = applicant.user.username + "#" + applicant.user.discriminator
applicant.user.username + "#" + applicant.user.discriminator
await message.edit({ await message.edit({
components: [ components: [
@@ -61,14 +50,11 @@ export = {
}) })
await applicant.send({ await applicant.send({
embeds: [ embeds: [{
{ description: "Your application for the Illegitimate guild has been accepted.\n\n" +
description:
"Your application for the Illegitimate guild has been accepted.\n\n" +
"Make sure to leave your current guild so that we can invite you.", "Make sure to leave your current guild so that we can invite you.",
color: embedColor color: embedColor
} }]
]
}) })
const applicantEntry = await guildapp.findOne({ userID: applicantId }) const applicantEntry = await guildapp.findOne({ userID: applicantId })
@@ -89,11 +75,9 @@ export = {
await guildapp.findOneAndDelete({ userID: applicantId }) await guildapp.findOneAndDelete({ userID: applicantId })
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
title: applicantUsername + " - Guild Application", title: applicantUsername + " - Guild Application",
description: description: "Application has been accepted by <@" + user.id + ">.",
"Application has been accepted by <@" + user.id + ">.",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: applicant.avatarURL() || "" url: applicant.avatarURL() || ""
@@ -102,15 +86,12 @@ export = {
icon_url: guild.iconURL() || undefined, icon_url: guild.iconURL() || undefined,
text: "ID: " + applicant.id text: "ID: " + applicant.id
} }
} }]
]
}) })
if (process.env.NODE_ENV === "dev") return if (process.env.NODE_ENV === "dev") return
try { try {
const channel = guild.channels.cache.get( const channel = guild.channels.cache.get(waitingListChannel) as TextChannel
waitingListChannel
) as TextChannel
const wlmessage = await channel!.messages.fetch(waitingListMessage) const wlmessage = await channel!.messages.fetch(waitingListMessage)
const wlembed = wlmessage.embeds[0] const wlembed = wlmessage.embeds[0]
@@ -138,8 +119,7 @@ export = {
} }
await wlmessage.edit({ await wlmessage.edit({
embeds: [ embeds: [{
{
title: wlembed.title!, title: wlembed.title!,
description: wlembed.description!, description: wlembed.description!,
color: wlembed.color!, color: wlembed.color!,
@@ -150,8 +130,7 @@ export = {
thumbnail: wlembed.thumbnail!, thumbnail: wlembed.thumbnail!,
fields: fields, fields: fields,
timestamp: new Date().toISOString() timestamp: new Date().toISOString()
} }]
]
}) })
} catch (err) { } catch (err) {
console.log( console.log(

View File

@@ -1,9 +1,4 @@
import { import { ModalBuilder, ActionRowBuilder, TextInputBuilder, TextInputStyle } from "discord.js"
ModalBuilder,
ActionRowBuilder,
TextInputBuilder,
TextInputStyle
} from "discord.js"
import { Button } from "interfaces" import { Button } from "interfaces"
export = { export = {
@@ -20,9 +15,7 @@ export = {
.setLabel("Deny Reason") .setLabel("Deny Reason")
.setCustomId("denyreason") .setCustomId("denyreason")
.setStyle(TextInputStyle.Paragraph) .setStyle(TextInputStyle.Paragraph)
.setPlaceholder( .setPlaceholder("Enter a reason for denying the application")
"Enter a reason for denying the application"
)
.setRequired(false) .setRequired(false)
) )
) )

View File

@@ -1,11 +1,4 @@
import { import { ButtonBuilder, ButtonStyle, ActionRowBuilder, EmbedBuilder, GuildMember, TextChannel } from "discord.js"
ButtonBuilder,
ButtonStyle,
ActionRowBuilder,
EmbedBuilder,
GuildMember,
TextChannel
} from "discord.js"
import { color } from "config/options.json" import { color } from "config/options.json"
import { largeM, smallM, ignM } from "config/limitmessages.json" import { largeM, smallM, ignM } from "config/limitmessages.json"
import { applicationsChannel } from "config/options.json" import { applicationsChannel } from "config/options.json"
@@ -21,6 +14,7 @@ export = {
description: "Guild application button.", description: "Guild application button.",
async execute(interaction) { async execute(interaction) {
await interaction.deferReply({ ephemeral: true })
const user = interaction.member as GuildMember const user = interaction.member as GuildMember
const guild = interaction.guild! const guild = interaction.guild!
const embedColor = Number(color.replace("#", "0x")) const embedColor = Number(color.replace("#", "0x"))
@@ -35,22 +29,15 @@ export = {
return guildQuestions[n - 1].r return guildQuestions[n - 1].r
} }
if (interaction.customId === "guildapply") {
await interaction.deferReply({ ephemeral: true })
if (userRoles.includes(guildRole)) { if (userRoles.includes(guildRole)) {
await interaction.editReply( await interaction.editReply("You are already a member of the guild.")
"You are already a member of the guild."
)
return return
} }
const application = await guildapp.findOne({ userID: user.user.id }) const application = await guildapp.findOne({ userID: user.user.id })
if (application) { if (application) {
await interaction.editReply( await interaction.editReply("You already have an application in progress.")
"You already have an application in progress."
)
return return
} }
@@ -61,23 +48,18 @@ export = {
.setDescription("You have cancelled your application.") .setDescription("You have cancelled your application.")
.setColor(embedColor) .setColor(embedColor)
const attachments = new EmbedBuilder() const attachments = new EmbedBuilder()
.setDescription( .setDescription("You have uploaded an attachment. Please do not upload images, videos, or GIFS.")
"You have uploaded an attachment. Please do not upload images, videos, or GIFS."
)
.setColor(embedColor) .setColor(embedColor)
try { try {
await user.send({ await user.send({
embeds: [ embeds: [{
{
title: "Guild Application", title: "Guild Application",
description: description: "If you wish to proceed with your application, please type `yes` otherwise type `cancel`.\n\n" +
"If you wish to proceed with your application, please type `yes` otherwise type `cancel`.\n\n" +
"**Do not upload images, videos, or GIFS.**\n" + "**Do not upload images, videos, or GIFS.**\n" +
"You have a minute to respond to this message.", "You have a minute to respond to this message.",
color: embedColor color: embedColor
} }]
]
}) })
} catch (error) { } catch (error) {
await interaction.editReply("Please enable your DMs.") await interaction.editReply("Please enable your DMs.")
@@ -106,20 +88,14 @@ export = {
// first question // first question
await user.send({ await user.send({
embeds: [ embeds: [{
{
title: "**Question 1**", title: "**Question 1**",
description: description: qu(1) + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + ignM + "`",
qu(1) +
"\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" +
ignM +
"`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 5 minutes to respond to this message." text: "You have 5 minutes to respond to this message."
} }
} }]
]
}) })
const answer1 = await user.dmChannel!.awaitMessages({ const answer1 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
@@ -140,26 +116,21 @@ export = {
} }
if (answer1.first()!.content.length > 16) { if (answer1.first()!.content.length > 16) {
await user.send({ await user.send({
embeds: [ embeds: [{
{
description: "Max character limit is 16.", description: "Max character limit is 16.",
color: embedColor color: embedColor
} }]
]
}) })
return return
} }
const uuid = await getUUID(answer1.first()!.content) const uuid = await getUUID(answer1.first()!.content)
if (!uuid) { if (!uuid) {
await user.send({ await user.send({
embeds: [ embeds: [{
{ description: "That is not a valid Minecraft username.\n" +
description:
"That is not a valid Minecraft username.\n" +
"Application cancelled.", "Application cancelled.",
color: embedColor color: embedColor
} }]
]
}) })
return return
} }
@@ -167,19 +138,14 @@ export = {
// second question // second question
await user.send({ await user.send({
embeds: [ embeds: [{
{
title: "**Question 2**", title: "**Question 2**",
description: description: qu(2) + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n" + "`(8 characters max)`",
qu(2) +
"\n\nPlease type your answer below or type `cancel` to cancel your application.\n" +
"`(8 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."
} }
} }]
]
}) })
const answer2 = await user.dmChannel!.awaitMessages({ const answer2 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
@@ -200,12 +166,10 @@ export = {
} }
if (answer2.first()!.content.length > 8) { if (answer2.first()!.content.length > 8) {
await user.send({ await user.send({
embeds: [ embeds: [{
{
description: "Max character limit is 8.", description: "Max character limit is 8.",
color: embedColor color: embedColor
} }]
]
}) })
return return
} }
@@ -213,20 +177,14 @@ export = {
// third question // third question
await user.send({ await user.send({
embeds: [ embeds: [{
{
title: "**Question 3**", title: "**Question 3**",
description: description: qu(3) + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + smallM + "`",
qu(3) +
"\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" +
smallM +
"`",
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."
} }
} }]
]
}) })
const answer3 = await user.dmChannel!.awaitMessages({ const answer3 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
@@ -247,33 +205,25 @@ export = {
} }
if (answer3.first()!.content.length > 128) { if (answer3.first()!.content.length > 128) {
await user.send({ await user.send({
embeds: [ embeds: [{
{
description: "Max character limit is 128.", description: "Max character limit is 128.",
color: embedColor color: embedColor
} }]
]
}) })
} }
const answer3_1 = answer3.first()!.content const answer3_1 = answer3.first()!.content
// fourth question // fourth question
await user.send({ await user.send({
embeds: [ embeds: [{
{
title: "**Question 4**", title: "**Question 4**",
description: description: qu(4) + "\n\nPlease type your answer below or type `cancel` to cancel your application." +
qu(4) + " `(We expect a longer answer.)`\n`" + largeM + "`",
"\n\nPlease type your answer below or type `cancel` to cancel your application." +
" `(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."
} }
} }]
]
}) })
const answer4 = await user.dmChannel!.awaitMessages({ const answer4 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
@@ -294,32 +244,24 @@ export = {
} }
if (answer4.first()!.content.length > 256) { if (answer4.first()!.content.length > 256) {
await user.send({ await user.send({
embeds: [ embeds: [{
{
description: "Max character limit is 256.", description: "Max character limit is 256.",
color: embedColor color: embedColor
} }]
]
}) })
} }
const answer4_1 = answer4.first()!.content const answer4_1 = answer4.first()!.content
// fifth question // fifth question
await user.send({ await user.send({
embeds: [ embeds: [{
{
title: "**Question 5**", title: "**Question 5**",
description: description: qu(5) + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + smallM + "`",
qu(5) +
"\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" +
smallM +
"`",
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."
} }
} }]
]
}) })
const answer5 = await user.dmChannel!.awaitMessages({ const answer5 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
@@ -340,32 +282,24 @@ export = {
} }
if (answer5.first()!.content.length > 128) { if (answer5.first()!.content.length > 128) {
await user.send({ await user.send({
embeds: [ embeds: [{
{
description: "Max character limit is 128.", description: "Max character limit is 128.",
color: embedColor color: embedColor
} }]
]
}) })
} }
const answer5_1 = answer5.first()!.content const answer5_1 = answer5.first()!.content
// sixth question // sixth question
await user.send({ await user.send({
embeds: [ embeds: [{
{
title: "**Question 6**", title: "**Question 6**",
description: description: qu(6) + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
qu(6) +
"\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."
} }
} }]
]
}) })
const answer6 = await user.dmChannel!.awaitMessages({ const answer6 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
@@ -386,32 +320,24 @@ export = {
} }
if (answer6.first()!.content.length > 256) { if (answer6.first()!.content.length > 256) {
await user.send({ await user.send({
embeds: [ embeds: [{
{
description: "Max character limit is 256.", description: "Max character limit is 256.",
color: embedColor color: embedColor
} }]
]
}) })
} }
const answer6_1 = answer6.first()!.content const answer6_1 = answer6.first()!.content
// seventh question // seventh question
await user.send({ await user.send({
embeds: [ embeds: [{
{
title: "**Question 7**", title: "**Question 7**",
description: description: qu(7) + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + smallM + "`",
qu(7) +
"\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" +
smallM +
"`",
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."
} }
} }]
]
}) })
const answer7 = await user.dmChannel!.awaitMessages({ const answer7 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
@@ -432,31 +358,24 @@ export = {
} }
if (answer7.first()!.content.length > 128) { if (answer7.first()!.content.length > 128) {
await user.send({ await user.send({
embeds: [ embeds: [{
{
description: "Max character limit is 128.", description: "Max character limit is 128.",
color: embedColor color: embedColor
} }]
]
}) })
} }
const answer7_1 = answer7!.first()!.content const answer7_1 = answer7!.first()!.content
// eighth question // eighth question
await user.send({ await user.send({
embeds: [ embeds: [{
{
title: "**Question 8**", title: "**Question 8**",
description: description: qu(8) + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n" + "`(64 characters max)`",
qu(8) +
"\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."
} }
} }]
]
}) })
const answer8 = await user.dmChannel!.awaitMessages({ const answer8 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
@@ -477,24 +396,19 @@ export = {
} }
if (answer8.first()!.content.length > 64) { if (answer8.first()!.content.length > 64) {
await user.send({ await user.send({
embeds: [ embeds: [{
{
description: "Max character limit is 64.", description: "Max character limit is 64.",
color: embedColor color: embedColor
} }]
]
}) })
} }
const answer8_1 = answer8.first()!.content const answer8_1 = answer8.first()!.content
await user.send({ await user.send({
embeds: [ embeds: [{
{ description: "If you want to submit your application, type `yes` if not, type `no`",
description:
"If you want to submit your application, type `yes` if not, type `no`",
color: embedColor color: embedColor
} }]
]
}) })
const final = await user.dmChannel!.awaitMessages({ const final = await user.dmChannel!.awaitMessages({
@@ -516,12 +430,10 @@ export = {
} }
await user.send({ await user.send({
embeds: [ embeds: [{
{
description: "Your application has been submitted!", description: "Your application has been submitted!",
color: embedColor color: embedColor
} }]
]
}) })
const newGuildApp = new guildapp({ const newGuildApp = new guildapp({
@@ -532,17 +444,10 @@ export = {
await newGuildApp.save() await newGuildApp.save()
const channel = guild.channels.cache.get( const channel = guild.channels.cache.get(applicationsChannel) as TextChannel
applicationsChannel
) as TextChannel
await channel.send({ await channel.send({
embeds: [ embeds: [{
{ title: user.user.username + "#" + user.user.discriminator + " - Guild Application",
title:
user.user.username +
"#" +
user.user.discriminator +
" - Guild Application",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: user.avatarURL() || "" url: user.avatarURL() || ""
@@ -585,8 +490,7 @@ export = {
icon_url: guild.iconURL() || "", icon_url: guild.iconURL() || "",
text: "ID: " + user.user.id text: "ID: " + user.user.id
} }
} }],
],
components: [ components: [
new ActionRowBuilder<ButtonBuilder>().addComponents( new ActionRowBuilder<ButtonBuilder>().addComponents(
new ButtonBuilder() new ButtonBuilder()
@@ -605,5 +509,4 @@ export = {
] ]
}) })
} }
}
} as Button } as Button

View File

@@ -1,35 +1,13 @@
import { import { ButtonBuilder, ActionRowBuilder, ButtonStyle, EmbedBuilder, GuildMember, TextChannel } from "discord.js"
ButtonBuilder, import { gm, manager, moderator, beast, member, guildStaff, guildRole } from "config/roles.json"
ActionRowBuilder,
ButtonStyle,
EmbedBuilder,
GuildMember,
TextChannel
} from "discord.js"
import {
gm,
manager,
moderator,
beast,
member,
guildStaff,
guildRole
} from "config/roles.json"
import { ignM, smallM, largeM } from "config/limitmessages.json" import { ignM, smallM, largeM } from "config/limitmessages.json"
import { inactivity } from "config/questions.json" import { inactivity } from "config/questions.json"
import { color, inactivityLogChannel } from "config/options.json" import { color, inactivityLogChannel } from "config/options.json"
import { Button } from "interfaces" import { Button } from "interfaces"
const guildRoles = [ import { getIGN } from "utils/Hypixel"
gm, const guildRoles = [gm, manager, moderator, beast, member, guildStaff, guildRole]
manager,
moderator,
beast,
member,
guildStaff,
guildRole
]
module.exports = { export = {
name: "guildinactivitylog", name: "guildinactivitylog",
description: "Configure the bot.", description: "Configure the bot.",
@@ -38,7 +16,6 @@ module.exports = {
const user = interaction.member as GuildMember const user = interaction.member as GuildMember
const embedColor = Number(color.replace("#", "0x")) const embedColor = Number(color.replace("#", "0x"))
const userRoles = user.roles.cache const userRoles = user.roles.cache
const mojangAPI = "https://api.mojang.com/users/profiles/minecraft/"
if (!userRoles.some(role => guildRoles.includes(role.id))) { if (!userRoles.some(role => guildRoles.includes(role.id))) {
return await interaction.reply({ return await interaction.reply({
@@ -62,25 +39,20 @@ module.exports = {
.setDescription("You have cancelled your application.") .setDescription("You have cancelled your application.")
.setColor(embedColor) .setColor(embedColor)
const attachments = new EmbedBuilder() const attachments = new EmbedBuilder()
.setDescription( .setDescription("You have uploaded an attachment. Please do not upload images, videos, or GIFS.")
"You have uploaded an attachment. Please do not upload images, videos, or GIFS."
)
.setColor(embedColor) .setColor(embedColor)
try { try {
await user.send({ await user.send({
embeds: [ embeds: [{
{
title: "Guild Inactivity Log", title: "Guild Inactivity Log",
description: description: "Please answer the following questions to submit an inactivity log for the guild.\n" +
"Please answer the following questions to submit an inactivity log for the guild.\n" +
"If you wish to cancel your form, please press type `cancel` at any time.\n" + "If you wish to cancel your form, please press type `cancel` at any time.\n" +
"If you wish to proceed with your form, please type `yes`.\n\n" + "If you wish to proceed with your form, please type `yes`.\n\n" +
"**Do not upload images, videos, or GIFS.**\n" + "**Do not upload images, videos, or GIFS.**\n" +
"You have a minute to respond to this message.", "You have a minute to respond to this message.",
color: embedColor color: embedColor
} }]
]
}) })
} catch (error) { } catch (error) {
return await interaction.reply({ return await interaction.reply({
@@ -113,20 +85,14 @@ module.exports = {
} }
await user.send({ await user.send({
embeds: [ embeds: [{
{
title: "**Question 1**", title: "**Question 1**",
description: description: sq(1) + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + ignM + "`",
sq(1) +
"\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" +
ignM +
"`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 5 minutes to respond to this message." text: "You have 5 minutes to respond to this message."
} }
} }]
]
}) })
const answer1 = await user.dmChannel!.awaitMessages({ const answer1 = await user.dmChannel!.awaitMessages({
@@ -140,27 +106,10 @@ module.exports = {
} }
if (answer1.first()!.content.length > 16) { if (answer1.first()!.content.length > 16) {
await user.send({ await user.send({
embeds: [ embeds: [{
{
description: "Max character limit is 16.", description: "Max character limit is 16.",
color: embedColor color: embedColor
} }]
]
})
return
}
try {
await fetch(mojangAPI + answer1.first()!.content)
} catch (error) {
await user.send({
embeds: [
{
description:
"That is not a valid Minecraft username.\n" +
"Application cancelled.",
color: embedColor
}
]
}) })
return return
} }
@@ -172,23 +121,27 @@ module.exports = {
await user.send({ embeds: [cancelled] }) await user.send({ embeds: [cancelled] })
return return
} }
if (await getIGN(answer1.first()!.content)) {
await user.send({
embeds: [{
description: "That is not a valid Minecraft username.\n" +
"Application cancelled.",
color: embedColor
}]
})
return
}
const answer1_1 = answer1.first()!.content const answer1_1 = answer1.first()!.content
await user.send({ await user.send({
embeds: [ embeds: [{
{
title: "**Question 2**", title: "**Question 2**",
description: description: sq(2) + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + smallM + "`",
sq(2) +
"\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" +
smallM +
"`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 5 minutes to respond to this message." text: "You have 5 minutes to respond to this message."
} }
} }]
]
}) })
const answer2 = await user.dmChannel!.awaitMessages({ const answer2 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
@@ -201,12 +154,10 @@ module.exports = {
} }
if (answer2.first()!.content.length > 128) { if (answer2.first()!.content.length > 128) {
await user.send({ await user.send({
embeds: [ embeds: [{
{
description: "Max character limit is 128.", description: "Max character limit is 128.",
color: embedColor color: embedColor
} }]
]
}) })
return return
} }
@@ -221,20 +172,14 @@ module.exports = {
const answer2_1 = answer1.first()!.content const answer2_1 = answer1.first()!.content
await user.send({ await user.send({
embeds: [ embeds: [{
{
title: "**Question 3**", title: "**Question 3**",
description: description: sq(3) + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
sq(3) +
"\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."
} }
} }]
]
}) })
const answer3 = await user.dmChannel!.awaitMessages({ const answer3 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
@@ -247,12 +192,10 @@ module.exports = {
} }
if (answer3.first()!.content.length > 256) { if (answer3.first()!.content.length > 256) {
await user.send({ await user.send({
embeds: [ embeds: [{
{
description: "Max character limit is 256", description: "Max character limit is 256",
color: embedColor color: embedColor
} }]
]
}) })
return return
} }
@@ -267,13 +210,10 @@ module.exports = {
const answer3_1 = answer1.first()!.content const answer3_1 = answer1.first()!.content
await user.send({ await user.send({
embeds: [ embeds: [{
{ description: "If you want to submit your application, type `yes` if not, type `no`",
description:
"If you want to submit your application, type `yes` if not, type `no`",
color: embedColor color: embedColor
} }]
]
}) })
const final = await user.dmChannel!.awaitMessages({ const final = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
@@ -294,26 +234,17 @@ module.exports = {
} }
await user.send({ await user.send({
embeds: [ embeds: [{
{
description: "Your application has been submitted!", description: "Your application has been submitted!",
color: embedColor color: embedColor
} }]
]
}) })
const appChannel = guild.channels.cache.get( const appChannel = guild.channels.cache.get(inactivityLogChannel) as TextChannel
inactivityLogChannel
) as TextChannel
await appChannel.send({ await appChannel.send({
embeds: [ embeds: [{
{ title: user.user.username + "#" + user.user.discriminator + " - Inactivity Application",
title:
user.user.username +
"#" +
user.user.discriminator +
" - Inactivity Application",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: user.avatarURL() || "" url: user.avatarURL() || ""
@@ -336,8 +267,7 @@ module.exports = {
icon_url: user.avatarURL() || undefined, icon_url: user.avatarURL() || undefined,
text: "ID: " + user.user.id text: "ID: " + user.user.id
} }
} }],
],
components: [ components: [
new ActionRowBuilder<ButtonBuilder>().addComponents( new ActionRowBuilder<ButtonBuilder>().addComponents(
new ButtonBuilder() new ButtonBuilder()

View File

@@ -19,17 +19,13 @@ export = {
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 = const applicantUsername = applicant.user.username + "#" + applicant.user.discriminator
applicant.user.username + "#" + applicant.user.discriminator
await applicant.send({ await applicant.send({
embeds: [ embeds: [{
{ description: "Your application for the Illegitimate staff team has been accepted.",
description:
"Your application for the Illegitimate staff team has been accepted.",
color: embedColor color: embedColor
} }]
]
}) })
await message.edit({ await message.edit({
@@ -52,8 +48,7 @@ export = {
await staffapp.findOneAndDelete({ userID: applicantId }) await staffapp.findOneAndDelete({ userID: applicantId })
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [{
{
title: applicantUsername + " - Staff Application.", title: applicantUsername + " - Staff Application.",
description: "Application accepted by <@" + user.id + ">.", description: "Application accepted by <@" + user.id + ">.",
color: embedColor, color: embedColor,
@@ -64,8 +59,7 @@ export = {
icon_url: guild.iconURL() || undefined, icon_url: guild.iconURL() || undefined,
text: "ID: " + applicantId text: "ID: " + applicantId
} }
} }]
]
}) })
} }
} as Button } as Button

View File

@@ -1,9 +1,4 @@
import { import { ModalBuilder, ActionRowBuilder, TextInputBuilder, TextInputStyle } from "discord.js"
ModalBuilder,
ActionRowBuilder,
TextInputBuilder,
TextInputStyle
} from "discord.js"
import { Button } from "interfaces" import { Button } from "interfaces"
export = { export = {
@@ -20,9 +15,7 @@ export = {
.setLabel("Deny Reason") .setLabel("Deny Reason")
.setCustomId("staffdenyreason") .setCustomId("staffdenyreason")
.setStyle(TextInputStyle.Paragraph) .setStyle(TextInputStyle.Paragraph)
.setPlaceholder( .setPlaceholder( "Enter a reason for denying the application")
"Enter a reason for denying the application"
)
.setRequired(false) .setRequired(false)
) )
) )

View File

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

View File

@@ -1,9 +1,4 @@
import { import { ModalBuilder, ActionRowBuilder, TextInputBuilder, TextInputStyle } from "discord.js"
ModalBuilder,
ActionRowBuilder,
TextInputBuilder,
TextInputStyle
} from "discord.js"
import { Button } from "interfaces" import { Button } from "interfaces"
export = { export = {

View File

@@ -37,8 +37,7 @@ export = {
} }
await message.edit({ await message.edit({
embeds: [ embeds: [{
{
title: embed.title!, title: embed.title!,
description: embed.description!, description: embed.description!,
color: embed.color!, color: embed.color!,
@@ -49,8 +48,7 @@ export = {
thumbnail: embed.thumbnail!, thumbnail: embed.thumbnail!,
fields: fields, fields: fields,
timestamp: new Date().toISOString() timestamp: new Date().toISOString()
} }]
]
}) })
await interaction.editReply("Updated the waiting list") await interaction.editReply("Updated the waiting list")