Updated formatting on modals and autocomplete
This commit is contained in:
@@ -9,21 +9,15 @@ export = {
|
||||
if (focusedOption.name !== "user") return
|
||||
|
||||
if (focusedOption.value === "") {
|
||||
await interaction.respond([
|
||||
{
|
||||
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,
|
||||
|
||||
@@ -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() || "")
|
||||
|
||||
@@ -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,16 +47,10 @@ export = {
|
||||
await staffapp.findOneAndDelete({ userID: applicantId })
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
embeds: [{
|
||||
title: "Application Denied",
|
||||
description:
|
||||
"The application has been denied by <@" +
|
||||
interaction.user.id +
|
||||
">.\n" +
|
||||
"**Reason:** `" +
|
||||
reason +
|
||||
"`",
|
||||
description: "The application has been denied by <@" + interaction.user.id + ">.\n" +
|
||||
"**Reason:** `" + reason + "`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: applicant.avatarURL() || ""
|
||||
@@ -75,8 +59,7 @@ export = {
|
||||
icon_url: guild!.iconURL() || undefined,
|
||||
text: "ID: " + applicant.id
|
||||
}
|
||||
}
|
||||
]
|
||||
}]
|
||||
})
|
||||
}
|
||||
} as Modal
|
||||
|
||||
@@ -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:
|
||||
"<a:questionmark_pink:1130206038008803488> That player does not exist.",
|
||||
embeds: [{
|
||||
description: "<a:questionmark_pink:1130206038008803488> That player does not exist.",
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -54,13 +38,10 @@ export = {
|
||||
const player = await getPlayer(uuid)
|
||||
if (!player) {
|
||||
interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"<a:questionmark_pink:1130206038008803488> That player hasn't played Hypixel before.",
|
||||
embeds: [{
|
||||
description: "<a:questionmark_pink:1130206038008803488> 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:
|
||||
"<a:cross_a:1087808606897983539> There is no Discord account linked to `" +
|
||||
player.displayname +
|
||||
"`.\n\n" +
|
||||
"**Please set your Discord tag on hypixel to `" +
|
||||
username +
|
||||
"` and try again.**",
|
||||
embeds: [{
|
||||
description: "<a:cross_a:1087808606897983539> 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:
|
||||
"<a:cross_a:1087808606897983539> The Discord account linked to `" +
|
||||
player.displayname +
|
||||
"` is currently `" +
|
||||
linkedDiscord +
|
||||
"`\n\n" +
|
||||
"**Please set your Discord tag on hypixel to `" +
|
||||
username +
|
||||
"` and try again.**",
|
||||
embeds: [{
|
||||
description: "<a:cross_a:1087808606897983539> 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,15 +132,9 @@ export = {
|
||||
await newVerify.save()
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
embeds: [{
|
||||
title: interaction.guild!.name,
|
||||
description:
|
||||
"You have successfully verified `" +
|
||||
username +
|
||||
"` with the account `" +
|
||||
player.displayname +
|
||||
"`.",
|
||||
description: "You have successfully verified `" + username + "` with the account `" + player.displayname + "`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head!
|
||||
@@ -186,8 +143,7 @@ export = {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: interaction.guild!.name + " | " + devMessage
|
||||
}
|
||||
}
|
||||
]
|
||||
}]
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user