Merge branch 'dev' into 'main'

Added dynamic embeds

See merge request illegitimate/illegitimate-bot!119
This commit is contained in:
2023-12-03 18:17:41 +00:00
8 changed files with 167 additions and 13 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: "Fetching 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,22 +72,27 @@ async function guildMember(interaction) {
rank = "[MVP++] "
}
await interaction.editReply({
embeds: [{
description: "Fetching 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
}

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

@@ -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) {

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: "Fetching your guild data...",
color: embedColor
}]
})
const guild = await getGuild(uuid)
let guildID = ""
if (!guild) {
@@ -113,6 +141,7 @@ module.exports = {
}
if (guildID === hypixelGuildID) {
const GuildMembers = guild.members
const guildRank = GuildMembers.find((member) => member.uuid === player.uuid).rank