Added dynamic embeds

This commit is contained in:
2023-12-03 18:44:01 +01:00
parent cf650e392a
commit 962a76fbea
8 changed files with 189 additions and 14 deletions

View File

@@ -31,6 +31,13 @@ module.exports = {
return
}
await interaction.editReply({
embeds: [{
description: "Fetching your uuid...",
color: embedColor
}]
})
const uuid = await getUUID(ign)
if (!uuid) {
interaction.editReply({
@@ -41,6 +48,13 @@ module.exports = {
return
}
await interaction.editReply({
embeds: [{
description: "Fetching your player data...",
color: embedColor
}]
})
const head = await getHeadURL(ign)
const player = await getPlayer(uuid)
if (!player) {
@@ -69,6 +83,13 @@ module.exports = {
rank = "[MVP++] "
}
await interaction.editReply({
embeds: [{
description: "Checking your guild data...",
color: embedColor
}]
})
const guild = await getGuild(uuid)
let guildName = ""
if (!guild) {

View File

@@ -51,8 +51,23 @@ module.exports = {
return
}
await interaction.editReply({
embeds: [{
description: "Fetching ign...",
color: embedColor,
}]
})
const ign = await getIGN(verifyData.uuid)
const head = await getHeadURL(ign)
await interaction.editReply({
embeds: [{
description: "Fetching guild data...",
color: embedColor,
}]
})
const guild = await getGuild(verifyData.uuid)
let responseGuildID = ""

View File

@@ -69,6 +69,13 @@ module.exports = {
modName = mod.username + "#" + mod.discriminator
}
await interaction.editReply({
embeds: [{
description: "Fetching their uuid...",
color: embedColor
}]
})
const uuid = await getUUID(ign)
if (!uuid) {
interaction.editReply({
@@ -80,6 +87,13 @@ module.exports = {
return
}
await interaction.editReply({
embeds: [{
description: "Fetching their player data...",
color: embedColor
}]
})
const player = await getPlayer(uuid)
if (!player) {
interaction.editReply({
@@ -91,6 +105,13 @@ module.exports = {
return
}
await interaction.editReply({
embeds: [{
description: "Fetching their guild data...",
color: embedColor
}]
})
const guild = await getGuild(uuid)
let responseGuildID = ""
if (!guild) {

View File

@@ -8,6 +8,13 @@ async function guildInfo(interaction) {
const ign = interaction.options.getString("ign")
const embedColor = Number(color.replace("#", "0x"))
await interaction.editReply({
embeds: [{
description: "Fetching your uuid...",
color: embedColor
}]
})
const uuid = await getUUID(ign)
if (!uuid) {
interaction.editReply({
@@ -19,6 +26,13 @@ async function guildInfo(interaction) {
return
}
await interaction.editReply({
embeds: [{
description: "Fetching your player data...",
color: embedColor
}]
})
const player = await getPlayer(uuid)
if (!player) {
interaction.editReply({
@@ -30,6 +44,13 @@ async function guildInfo(interaction) {
return
}
await interaction.editReply({
embeds: [{
description: "Fetching your guild data...",
color: embedColor
}]
})
const guild = await getGuild(uuid)
if (!guild) {
interaction.editReply({

View File

@@ -7,6 +7,13 @@ async function guildMember(interaction) {
const ign = interaction.options.getString("ign")
const embedColor = Number(color.replace("#", "0x"))
await interaction.editReply({
embeds: [{
description: "Fetching your uuid...",
color: embedColor
}]
})
const uuid = await getUUID(ign)
if (!uuid) {
interaction.editReply({
@@ -20,6 +27,13 @@ async function guildMember(interaction) {
return
}
await interaction.editReply({
embeds: [{
description: "Fetching your player data...",
color: embedColor
}]
})
const head = await getHeadURL(ign)
const player = await getPlayer(uuid)
if (!player) {
@@ -58,11 +72,17 @@ async function guildMember(interaction) {
rank = "[MVP++] "
}
await interaction.editReply({
embeds: [{
description: "Checking your guild data...",
color: embedColor
}]
})
const guild = await getGuild(uuid)
if (!guild) {
await interaction.editReply({
embeds: [
{
embeds: [{
description: "This user is not in a guild",
color: embedColor,
thumbnail: {
@@ -72,8 +92,7 @@ async function guildMember(interaction) {
text: interaction.guild.name + " | " + devMessage,
icon_url: interaction.guild.iconURL({ dynamic: true }),
},
},
],
}],
})
return
}

View File

@@ -14,6 +14,13 @@ async function beast(interaction) {
return
}
await interaction.editReply({
embeds: [{
description: "Fetching your uuid...",
color: embedColor
}]
})
const uuid = await getUUID(ign)
if (!uuid) {
interaction.editReply({
@@ -24,6 +31,13 @@ async function beast(interaction) {
return
}
await interaction.editReply({
embeds: [{
description: "Fetching your player data...",
color: embedColor
}]
})
const head = await getHeadURL(ign)
const player = await getPlayer(uuid)
if (!player) {
@@ -52,6 +66,13 @@ async function beast(interaction) {
rank = "[MVP++] "
}
await interaction.editReply({
embeds: [{
description: "Fetching your guild data...",
color: embedColor
}]
})
const guild = await getGuild(uuid)
let guildName = ""
if (!guild) {

View File

@@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js")
const { SlashCommandBuilder, InteractionResponse } = require("discord.js")
const { getGuild, getIGN, getHeadURL } = require("../utils/utils.js")
const verify = require("../schemas/verifySchema.js")
const { color, hypixelGuildID, devMessage } = require("../../config/options.json")
@@ -9,7 +9,7 @@ module.exports = {
name: "update",
description: "Update your guild rank.",
type: "slash",
dev: true,
dev: false,
public: true,
data: new SlashCommandBuilder()
@@ -43,6 +43,13 @@ module.exports = {
return
}
await interaction.editReply({
embeds: [{
description: "Fetching your guild data...",
color: embedColor,
}]
})
const guild = await getGuild(verifyData.uuid)
let guildID = ""
if (!guild) {
@@ -55,6 +62,12 @@ module.exports = {
const head = await getHeadURL(ign)
if (guildID !== hypixelGuildID) {
await interaction.editReply({
description: "You are not a member of illegitimate\n" +
"Just a moment while I update your roles...",
color: embedColor,
})
for (let i = 0; i < removeThese.length; i++) {
await roleManage.remove(removeThese[i], "Auto role removal. (Update)")
}
@@ -77,6 +90,14 @@ module.exports = {
return
}
await interaction.editReply({
embeds: [{
description: "You are a member of illegitimate\n" +
"Just a moment while I update your roles...",
color: embedColor,
}]
})
if (guildID === hypixelGuildID) {
const GuildMembers = guild.members

View File

@@ -47,6 +47,13 @@ module.exports = {
return
}
await interaction.editReply({
embeds: [{
description: "Fetching your uuid...",
color: embedColor
}]
})
const uuid = await getUUID(ign)
if (!uuid) {
interaction.editReply({
@@ -58,6 +65,13 @@ module.exports = {
return
}
await interaction.editReply({
embeds: [{
description: "Fetching your player data...",
color: embedColor
}]
})
const head = await getHeadURL(ign)
const player = await getPlayer(uuid)
if (!player) {
@@ -77,6 +91,13 @@ module.exports = {
username = user1.username + "#" + user1.discriminator
}
await interaction.editReply({
embeds: [{
description: "Checking your Discord tag...",
color: embedColor
}]
})
const linkedDiscord = player?.socialMedia?.links?.DISCORD || null
if (!linkedDiscord) {
interaction.editReply({
@@ -104,6 +125,13 @@ module.exports = {
return
}
await interaction.editReply({
embeds: [{
description: "Checking your guild...",
color: embedColor
}]
})
const guild = await getGuild(uuid)
let guildID = ""
if (!guild) {
@@ -113,6 +141,14 @@ module.exports = {
}
if (guildID === hypixelGuildID) {
await interaction.editReply({
embeds: [{
description: "You are a member of the guild `" + guild.name + "`!",
color: embedColor
}]
})
const GuildMembers = guild.members
const guildRank = GuildMembers.find((member) => member.uuid === player.uuid).rank