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

@@ -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,22 +72,27 @@ 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: [
{
description: "This user is not in a guild",
color: embedColor,
thumbnail: {
url: head,
},
footer: {
text: interaction.guild.name + " | " + devMessage,
icon_url: interaction.guild.iconURL({ dynamic: true }),
},
embeds: [{
description: "This user is not in a guild",
color: embedColor,
thumbnail: {
url: head,
},
],
footer: {
text: interaction.guild.name + " | " + devMessage,
icon_url: interaction.guild.iconURL({ dynamic: true }),
},
}],
})
return
}