From 1ca511febf237aa786be304291514efaaee51b1b Mon Sep 17 00:00:00 2001 From: Taken Date: Sat, 8 Mar 2025 19:22:28 +0100 Subject: [PATCH] Removed unused --- src/commands/setup.ts | 20 ---- src/components/buttons/verify.ts | 26 ----- src/components/modals/verifyModal.ts | 144 --------------------------- 3 files changed, 190 deletions(-) delete mode 100644 src/components/buttons/verify.ts delete mode 100644 src/components/modals/verifyModal.ts diff --git a/src/commands/setup.ts b/src/commands/setup.ts index f49a078..b978354 100644 --- a/src/commands/setup.ts +++ b/src/commands/setup.ts @@ -46,18 +46,6 @@ export default { .setRequired(true) ) ) - .addSubcommand(subcommand => - subcommand - .setName("sendverfiymessage") - .setDescription("Send the verfiy message to a channel.") - .addChannelOption(option => - option - .setName("channel") - .setDescription("The channel to send the verfiy message to.") - .addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement) - .setRequired(true) - ) - ) .addSubcommand(subcommand => subcommand .setName("sendwaitinglistmessage") @@ -118,14 +106,6 @@ export default { emoji = "✅" } - if (subcommand === "sendverfiymessage") { - title = "Verification" - description = "You can verify by clicking the button below." - customId = "verify" - label = "Verify" - emoji = "✅" - } - if (subcommand === "sendwaitinglistmessage") { title = "Waiting List" description = "The people on the waiting list" diff --git a/src/components/buttons/verify.ts b/src/components/buttons/verify.ts deleted file mode 100644 index e7c8adb..0000000 --- a/src/components/buttons/verify.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { ActionRowBuilder, ModalBuilder, TextInputBuilder, TextInputStyle } from "discord.js" -import { IButton } from "~/typings" - -export default { - name: "verify", - description: "Configure the bot.", - - async execute({ interaction }) { - const modal = new ModalBuilder() - .setTitle("Verification") - .setCustomId("verifybox") - .setComponents( - new ActionRowBuilder().setComponents( - new TextInputBuilder() - .setLabel("IGN") - .setCustomId("verifyign") - .setStyle(TextInputStyle.Short) - .setPlaceholder("Enter your ign.") - .setRequired(true) - .setMinLength(3) - .setMaxLength(16) - ) - ) - await interaction.showModal(modal) - } -} as IButton diff --git a/src/components/modals/verifyModal.ts b/src/components/modals/verifyModal.ts deleted file mode 100644 index 767f616..0000000 --- a/src/components/modals/verifyModal.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { GuildMember, MessageFlags } from "discord.js" -import { addVerify, getVerify } from "src/drizzle/functions" -import { devMessage, embedColor, hypixelGuildID } from "~/config/options" -import { IModal } from "~/typings" -import getGuildRank from "~/utils/Functions/guildrank" -import roleManage from "~/utils/Functions/rolesmanage" -import { getGuild, getHeadURL, getPlayer, getUUID } from "~/utils/Hypixel" - -export default { - name: "verifybox", - description: "Verify box.", - - async execute({ interaction }) { - await interaction.deferReply({ flags: MessageFlags.Ephemeral }) - - const user = interaction.member as GuildMember - const ign = interaction.fields.fields.get("verifyign")!.value - const verifyData = await getVerify({ userID: user.id }) - if (verifyData) { - interaction.editReply("You are already verified.\n" + "Try running /update to update your roles.") - return - } - - await interaction.editReply({ - embeds: [{ - description: "Fetching your uuid...", - color: embedColor - }] - }) - - const uuid = await getUUID(ign) - if (!uuid) { - interaction.editReply({ - embeds: [{ - description: " That player does not exist.", - color: embedColor - }] - }) - return - } - - await interaction.editReply({ - embeds: [{ - description: "Fetching your player data...", - color: embedColor - }] - }) - - const head = getHeadURL(ign) - const player = await getPlayer(uuid) - if (!player) { - interaction.editReply({ - embeds: [{ - description: " That player hasn't played Hypixel before.", - color: embedColor - }] - }) - return - } - - const username = user.user.username - - await interaction.editReply({ - embeds: [{ - description: "Checking your Discord tag...", - color: embedColor - }] - }) - - 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 - }] - }) - 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 - }] - }) - return - } - - await interaction.editReply({ - embeds: [{ - description: "Fetching your guild data...", - color: embedColor - }] - }) - - const guild = await getGuild(uuid) - let guildID: string | null - if (!guild) { - guildID = null - } else { - guildID = guild._id - } - - if (guildID === hypixelGuildID) { - const GuildMembers = guild!.members - const guildRank = GuildMembers.find(member => member.uuid === player.uuid)!.rank - - const rank = getGuildRank(guildRank) - if (rank) { - await user.roles.add(rank.rolesToAdd, "Verification") - } - - await user.roles.add(roleManage("default").rolesToAdd, "Verification") - await user.setNickname(player.displayname!, "Verification").catch(() => { - // Do nothing - }) - - await addVerify({ - userID: user.id, - uuid: uuid - }) - - 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 - } - }] - }) - } - } -} as IModal