Added dynamic embeds
This commit is contained in:
@@ -31,6 +31,13 @@ module.exports = {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Fetching your uuid...",
|
||||||
|
color: embedColor
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const uuid = await getUUID(ign)
|
const uuid = await getUUID(ign)
|
||||||
if (!uuid) {
|
if (!uuid) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
@@ -41,6 +48,13 @@ module.exports = {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Fetching your player data...",
|
||||||
|
color: embedColor
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const head = await getHeadURL(ign)
|
const head = await getHeadURL(ign)
|
||||||
const player = await getPlayer(uuid)
|
const player = await getPlayer(uuid)
|
||||||
if (!player) {
|
if (!player) {
|
||||||
@@ -69,6 +83,13 @@ module.exports = {
|
|||||||
rank = "[MVP++] "
|
rank = "[MVP++] "
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Checking your guild data...",
|
||||||
|
color: embedColor
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const guild = await getGuild(uuid)
|
const guild = await getGuild(uuid)
|
||||||
let guildName = ""
|
let guildName = ""
|
||||||
if (!guild) {
|
if (!guild) {
|
||||||
|
|||||||
@@ -51,8 +51,23 @@ module.exports = {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Fetching ign...",
|
||||||
|
color: embedColor,
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const ign = await getIGN(verifyData.uuid)
|
const ign = await getIGN(verifyData.uuid)
|
||||||
const head = await getHeadURL(ign)
|
const head = await getHeadURL(ign)
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Fetching guild data...",
|
||||||
|
color: embedColor,
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const guild = await getGuild(verifyData.uuid)
|
const guild = await getGuild(verifyData.uuid)
|
||||||
|
|
||||||
let responseGuildID = ""
|
let responseGuildID = ""
|
||||||
|
|||||||
@@ -69,6 +69,13 @@ module.exports = {
|
|||||||
modName = mod.username + "#" + mod.discriminator
|
modName = mod.username + "#" + mod.discriminator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Fetching their uuid...",
|
||||||
|
color: embedColor
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const uuid = await getUUID(ign)
|
const uuid = await getUUID(ign)
|
||||||
if (!uuid) {
|
if (!uuid) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
@@ -80,6 +87,13 @@ module.exports = {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Fetching their player data...",
|
||||||
|
color: embedColor
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const player = await getPlayer(uuid)
|
const player = await getPlayer(uuid)
|
||||||
if (!player) {
|
if (!player) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
@@ -91,6 +105,13 @@ module.exports = {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Fetching their guild data...",
|
||||||
|
color: embedColor
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const guild = await getGuild(uuid)
|
const guild = await getGuild(uuid)
|
||||||
let responseGuildID = ""
|
let responseGuildID = ""
|
||||||
if (!guild) {
|
if (!guild) {
|
||||||
|
|||||||
@@ -8,6 +8,13 @@ async function guildInfo(interaction) {
|
|||||||
const ign = interaction.options.getString("ign")
|
const ign = interaction.options.getString("ign")
|
||||||
const embedColor = Number(color.replace("#", "0x"))
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Fetching your uuid...",
|
||||||
|
color: embedColor
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const uuid = await getUUID(ign)
|
const uuid = await getUUID(ign)
|
||||||
if (!uuid) {
|
if (!uuid) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
@@ -19,6 +26,13 @@ async function guildInfo(interaction) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Fetching your player data...",
|
||||||
|
color: embedColor
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const player = await getPlayer(uuid)
|
const player = await getPlayer(uuid)
|
||||||
if (!player) {
|
if (!player) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
@@ -30,6 +44,13 @@ async function guildInfo(interaction) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Fetching your guild data...",
|
||||||
|
color: embedColor
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const guild = await getGuild(uuid)
|
const guild = await getGuild(uuid)
|
||||||
if (!guild) {
|
if (!guild) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
|
|||||||
@@ -7,6 +7,13 @@ async function guildMember(interaction) {
|
|||||||
const ign = interaction.options.getString("ign")
|
const ign = interaction.options.getString("ign")
|
||||||
const embedColor = Number(color.replace("#", "0x"))
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Fetching your uuid...",
|
||||||
|
color: embedColor
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const uuid = await getUUID(ign)
|
const uuid = await getUUID(ign)
|
||||||
if (!uuid) {
|
if (!uuid) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
@@ -20,6 +27,13 @@ async function guildMember(interaction) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Fetching your player data...",
|
||||||
|
color: embedColor
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const head = await getHeadURL(ign)
|
const head = await getHeadURL(ign)
|
||||||
const player = await getPlayer(uuid)
|
const player = await getPlayer(uuid)
|
||||||
if (!player) {
|
if (!player) {
|
||||||
@@ -58,22 +72,27 @@ async function guildMember(interaction) {
|
|||||||
rank = "[MVP++] "
|
rank = "[MVP++] "
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Checking your guild data...",
|
||||||
|
color: embedColor
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const guild = await getGuild(uuid)
|
const guild = await getGuild(uuid)
|
||||||
if (!guild) {
|
if (!guild) {
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
description: "This user is not in a guild",
|
||||||
description: "This user is not in a guild",
|
color: embedColor,
|
||||||
color: embedColor,
|
thumbnail: {
|
||||||
thumbnail: {
|
url: head,
|
||||||
url: head,
|
|
||||||
},
|
|
||||||
footer: {
|
|
||||||
text: interaction.guild.name + " | " + devMessage,
|
|
||||||
icon_url: interaction.guild.iconURL({ dynamic: true }),
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
footer: {
|
||||||
|
text: interaction.guild.name + " | " + devMessage,
|
||||||
|
icon_url: interaction.guild.iconURL({ dynamic: true }),
|
||||||
|
},
|
||||||
|
}],
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,13 @@ async function beast(interaction) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Fetching your uuid...",
|
||||||
|
color: embedColor
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const uuid = await getUUID(ign)
|
const uuid = await getUUID(ign)
|
||||||
if (!uuid) {
|
if (!uuid) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
@@ -24,6 +31,13 @@ async function beast(interaction) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Fetching your player data...",
|
||||||
|
color: embedColor
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const head = await getHeadURL(ign)
|
const head = await getHeadURL(ign)
|
||||||
const player = await getPlayer(uuid)
|
const player = await getPlayer(uuid)
|
||||||
if (!player) {
|
if (!player) {
|
||||||
@@ -52,6 +66,13 @@ async function beast(interaction) {
|
|||||||
rank = "[MVP++] "
|
rank = "[MVP++] "
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Fetching your guild data...",
|
||||||
|
color: embedColor
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const guild = await getGuild(uuid)
|
const guild = await getGuild(uuid)
|
||||||
let guildName = ""
|
let guildName = ""
|
||||||
if (!guild) {
|
if (!guild) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const { SlashCommandBuilder } = require("discord.js")
|
const { SlashCommandBuilder, InteractionResponse } = require("discord.js")
|
||||||
const { getGuild, getIGN, getHeadURL } = require("../utils/utils.js")
|
const { getGuild, getIGN, getHeadURL } = require("../utils/utils.js")
|
||||||
const verify = require("../schemas/verifySchema.js")
|
const verify = require("../schemas/verifySchema.js")
|
||||||
const { color, hypixelGuildID, devMessage } = require("../../config/options.json")
|
const { color, hypixelGuildID, devMessage } = require("../../config/options.json")
|
||||||
@@ -9,7 +9,7 @@ module.exports = {
|
|||||||
name: "update",
|
name: "update",
|
||||||
description: "Update your guild rank.",
|
description: "Update your guild rank.",
|
||||||
type: "slash",
|
type: "slash",
|
||||||
dev: true,
|
dev: false,
|
||||||
public: true,
|
public: true,
|
||||||
|
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
@@ -43,6 +43,13 @@ module.exports = {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Fetching your guild data...",
|
||||||
|
color: embedColor,
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const guild = await getGuild(verifyData.uuid)
|
const guild = await getGuild(verifyData.uuid)
|
||||||
let guildID = ""
|
let guildID = ""
|
||||||
if (!guild) {
|
if (!guild) {
|
||||||
@@ -55,6 +62,12 @@ module.exports = {
|
|||||||
const head = await getHeadURL(ign)
|
const head = await getHeadURL(ign)
|
||||||
if (guildID !== hypixelGuildID) {
|
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++) {
|
for (let i = 0; i < removeThese.length; i++) {
|
||||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)")
|
await roleManage.remove(removeThese[i], "Auto role removal. (Update)")
|
||||||
}
|
}
|
||||||
@@ -77,6 +90,14 @@ module.exports = {
|
|||||||
return
|
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) {
|
if (guildID === hypixelGuildID) {
|
||||||
|
|
||||||
const GuildMembers = guild.members
|
const GuildMembers = guild.members
|
||||||
|
|||||||
@@ -47,6 +47,13 @@ module.exports = {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Fetching your uuid...",
|
||||||
|
color: embedColor
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const uuid = await getUUID(ign)
|
const uuid = await getUUID(ign)
|
||||||
if (!uuid) {
|
if (!uuid) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
@@ -58,6 +65,13 @@ module.exports = {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Fetching your player data...",
|
||||||
|
color: embedColor
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const head = await getHeadURL(ign)
|
const head = await getHeadURL(ign)
|
||||||
const player = await getPlayer(uuid)
|
const player = await getPlayer(uuid)
|
||||||
if (!player) {
|
if (!player) {
|
||||||
@@ -77,6 +91,13 @@ module.exports = {
|
|||||||
username = user1.username + "#" + user1.discriminator
|
username = user1.username + "#" + user1.discriminator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Checking your Discord tag...",
|
||||||
|
color: embedColor
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const linkedDiscord = player?.socialMedia?.links?.DISCORD || null
|
const linkedDiscord = player?.socialMedia?.links?.DISCORD || null
|
||||||
if (!linkedDiscord) {
|
if (!linkedDiscord) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
@@ -104,6 +125,13 @@ module.exports = {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "Checking your guild...",
|
||||||
|
color: embedColor
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const guild = await getGuild(uuid)
|
const guild = await getGuild(uuid)
|
||||||
let guildID = ""
|
let guildID = ""
|
||||||
if (!guild) {
|
if (!guild) {
|
||||||
@@ -113,6 +141,14 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (guildID === hypixelGuildID) {
|
if (guildID === hypixelGuildID) {
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [{
|
||||||
|
description: "You are a member of the guild `" + guild.name + "`!",
|
||||||
|
color: embedColor
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
const GuildMembers = guild.members
|
const GuildMembers = guild.members
|
||||||
const guildRank = GuildMembers.find((member) => member.uuid === player.uuid).rank
|
const guildRank = GuildMembers.find((member) => member.uuid === player.uuid).rank
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user