diff --git a/src/components/autocomplete/unban.ts b/src/components/autocomplete/unban.ts index 8597051..192f834 100644 --- a/src/components/autocomplete/unban.ts +++ b/src/components/autocomplete/unban.ts @@ -9,21 +9,15 @@ export = { if (focusedOption.name !== "user") return if (focusedOption.value === "") { - await interaction.respond([ - { - name: "Please start typing a username to unban", - value: "none" - } - ]) + await interaction.respond([{ + name: "Please start typing a username to unban", + value: "none" + }]) return } const bannedUsers = await interaction.guild!.bans.fetch() - const filteredUsers = bannedUsers.filter(user => - user.user.username - .toLowerCase() - .includes(focusedOption.value.toLowerCase()) - ) + const filteredUsers = bannedUsers.filter(user => user.user.username.toLowerCase().includes(focusedOption.value.toLowerCase())) const results = filteredUsers.map(user => ({ name: user.user.username, diff --git a/src/components/modals/denyreasonbox.ts b/src/components/modals/denyreasonbox.ts index 869b18d..a4eb0d0 100644 --- a/src/components/modals/denyreasonbox.ts +++ b/src/components/modals/denyreasonbox.ts @@ -1,11 +1,4 @@ -import { - EmbedBuilder, - ActionRowBuilder, - ButtonBuilder, - ButtonStyle, - Message, - GuildMember -} from "discord.js" +import { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, Message, GuildMember } from "discord.js" import { color } from "config/options.json" import guildapp from "schemas/guildAppSchema" import { Modal } from "interfaces" @@ -22,9 +15,7 @@ export = { const embed = message.embeds[0] const applicantId = embed.footer!.text.split(" ")[1] - 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")) await message.edit({ @@ -57,29 +48,19 @@ export = { } 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) const missingUser = new EmbedBuilder() - .setDescription( - "[WARN] User has left the server and cannot be notified." - ) + .setDescription("[WARN] User has left the server and cannot be notified.") .setColor(embedColor) const responseEmbed = new EmbedBuilder() .setTitle("Application Denied") - .setDescription( - "The application has been denied by <@" + - interaction.user.id + - ">.\n" + - "**Reason:** `" + - reason + - "`" + .setDescription("The application has been denied by <@" + interaction.user.id + ">.\n" + + "**Reason:** `" + reason + "`" ) .setColor(embedColor) .setThumbnail(guild.iconURL() || "") diff --git a/src/components/modals/staffdenyreasonbox.ts b/src/components/modals/staffdenyreasonbox.ts index c16aa89..c822a0b 100644 --- a/src/components/modals/staffdenyreasonbox.ts +++ b/src/components/modals/staffdenyreasonbox.ts @@ -1,9 +1,4 @@ -import { - EmbedBuilder, - ActionRowBuilder, - ButtonBuilder, - ButtonStyle -} from "discord.js" +import { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js" import { color } from "config/options.json" import staffapp from "schemas/staffAppSchema" import { Modal } from "interfaces" @@ -16,9 +11,7 @@ export = { await interaction.deferReply() const guild = interaction.guild - const reason = - interaction.fields.fields.get("staffdenyreason")!.value || - "No reason provided" + const reason = interaction.fields.fields.get("staffdenyreason")!.value || "No reason provided" const embedColor = Number(color.replace("#", "0x")) const message = interaction.message! @@ -44,11 +37,8 @@ export = { }) const dmMessage = new EmbedBuilder() - .setDescription( - "Your application for the Illegitimate guild staff has been denied\n" + - "**Reason:** `" + - reason + - "`" + .setDescription("Your application for the Illegitimate guild staff has been denied\n" + + "**Reason:** `" + reason + "`" ) .setColor(embedColor) @@ -57,26 +47,19 @@ export = { await staffapp.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: { - icon_url: guild!.iconURL() || undefined, - 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: { + icon_url: guild!.iconURL() || undefined, + text: "ID: " + applicant.id } - ] + }] }) } } as Modal diff --git a/src/components/modals/verifyModal.ts b/src/components/modals/verifyModal.ts index 58a085b..0ed73db 100644 --- a/src/components/modals/verifyModal.ts +++ b/src/components/modals/verifyModal.ts @@ -2,17 +2,7 @@ import { getUUID, getPlayer, getGuild, getHeadURL } from "utils/Hypixel" import { color, hypixelGuildID, devMessage } from "config/options.json" import verify from "schemas/verifySchema" import mongoose from "mongoose" -import { - gm, - manager, - moderator, - beast, - elite, - member, - guildRole, - guildStaff, - defaultMember -} from "config/roles.json" +import { gm, manager, moderator, beast, elite, member, guildRole, guildStaff, defaultMember } from "config/roles.json" import { Modal } from "interfaces" import { GuildMember } from "discord.js" @@ -29,23 +19,17 @@ export = { const verifyData = await verify.findOne({ userID: user.user.id }) if (verifyData) { - interaction.editReply( - "You are already verified.\n" + - "Try running /update to update your roles." - ) + interaction.editReply("You are already verified.\n" + "Try running /update to update your roles.") return } const uuid = await getUUID(ign) if (!uuid) { interaction.editReply({ - embeds: [ - { - description: - " That player does not exist.", - color: embedColor - } - ] + embeds: [{ + description: " That player does not exist.", + color: embedColor + }] }) return } @@ -54,13 +38,10 @@ export = { const player = await getPlayer(uuid) if (!player) { interaction.editReply({ - embeds: [ - { - description: - " That player hasn't played Hypixel before.", - color: embedColor - } - ] + embeds: [{ + description: " That player hasn't played Hypixel before.", + color: embedColor + }] }) return } @@ -75,38 +56,22 @@ export = { const linkedDiscord = player?.socialMedia?.links?.DISCORD if (!linkedDiscord) { interaction.editReply({ - embeds: [ - { - description: - " There is no Discord account linked to `" + - player.displayname + - "`.\n\n" + - "**Please set your Discord tag on hypixel to `" + - username + - "` and try again.**", - color: embedColor - } - ] + embeds: [{ + description: " There is no Discord account linked to `" + player.displayname + "`.\n\n" + + "**Please set your Discord tag on hypixel to `" + username + "` and try again.**", + color: embedColor + }] }) return } if (linkedDiscord !== username) { interaction.editReply({ - embeds: [ - { - description: - " The Discord account linked to `" + - player.displayname + - "` is currently `" + - linkedDiscord + - "`\n\n" + - "**Please set your Discord tag on hypixel to `" + - username + - "` and try again.**", - color: embedColor - } - ] + embeds: [{ + description: " The Discord account linked to `" + player.displayname + "` is currently `" + linkedDiscord + "`\n\n" + + "**Please set your Discord tag on hypixel to `" + username + "` and try again.**", + color: embedColor + }] }) return } @@ -121,9 +86,7 @@ export = { if (guildID === hypixelGuildID) { const GuildMembers = guild!.members - const guildRank = GuildMembers.find( - member => member.uuid === player.uuid - )!.rank + const guildRank = GuildMembers.find(member => member.uuid === player.uuid)!.rank if (guildRank === "Guild Master" && guildID === hypixelGuildID) { await user.roles.add(gm, "Verification") @@ -169,25 +132,18 @@ export = { await newVerify.save() await interaction.editReply({ - embeds: [ - { - title: interaction.guild!.name, - description: - "You have successfully verified `" + - username + - "` with the account `" + - player.displayname + - "`.", - color: embedColor, - thumbnail: { - url: head! - }, - footer: { - icon_url: interaction.guild!.iconURL() || undefined, - text: interaction.guild!.name + " | " + devMessage - } + embeds: [{ + title: interaction.guild!.name, + description: "You have successfully verified `" + username + "` with the account `" + player.displayname + "`.", + color: embedColor, + thumbnail: { + url: head! + }, + footer: { + icon_url: interaction.guild!.iconURL() || undefined, + text: interaction.guild!.name + " | " + devMessage } - ] + }] }) } }