From 584ef8cc807c47e85be995fbafb937ab3cf9b2f6 Mon Sep 17 00:00:00 2001 From: Taken Date: Sun, 7 Jan 2024 17:18:31 +0100 Subject: [PATCH] Updated subcommands embed prefs --- src/commands/counting/ban.ts | 4 +--- src/commands/counting/setup.ts | 2 +- src/commands/counting/unban.ts | 4 +--- src/commands/guild/member.ts | 4 +--- src/commands/guild/top.ts | 4 +--- src/commands/staff/beast.ts | 11 ++--------- src/commands/staff/help.ts | 12 +++--------- 7 files changed, 10 insertions(+), 31 deletions(-) diff --git a/src/commands/counting/ban.ts b/src/commands/counting/ban.ts index 1e8006a..d0454b1 100644 --- a/src/commands/counting/ban.ts +++ b/src/commands/counting/ban.ts @@ -40,9 +40,7 @@ export default async function ban( " has been banned from counting", color: embedColor, footer: { - icon_url: interaction.guild!.iconURL({ - forceStatic: false, - })!, + icon_url: interaction.guild!.iconURL({ forceStatic: false, }) || undefined, text: interaction.guild!.name + " | " + devMessage, }, }, diff --git a/src/commands/counting/setup.ts b/src/commands/counting/setup.ts index 6ebce53..7c6704d 100644 --- a/src/commands/counting/setup.ts +++ b/src/commands/counting/setup.ts @@ -35,7 +35,7 @@ export default async function setup(interaction: ChatInputCommandInteraction): P description: "Counting channel has been set to " + channelMention(channel.id), color: embedColor, footer: { - icon_url: interaction.guild!.iconURL({ forceStatic: false })!, + icon_url: interaction.guild!.iconURL({ forceStatic: false }) || undefined, text: interaction.guild!.name + " | " + devMessage } }] diff --git a/src/commands/counting/unban.ts b/src/commands/counting/unban.ts index cf2f5bd..10d6cc5 100644 --- a/src/commands/counting/unban.ts +++ b/src/commands/counting/unban.ts @@ -40,9 +40,7 @@ export default async function ban( " has been unbanned from counting", color: embedColor, footer: { - icon_url: interaction.guild!.iconURL({ - forceStatic: false, - })!, + icon_url: interaction.guild!.iconURL({ forceStatic: false, }) || undefined, text: interaction.guild!.name + " | " + devMessage, }, }, diff --git a/src/commands/guild/member.ts b/src/commands/guild/member.ts index 9a09b49..99f5fee 100644 --- a/src/commands/guild/member.ts +++ b/src/commands/guild/member.ts @@ -204,9 +204,7 @@ export default async function guildMember( ], footer: { text: interaction.guild!.name + " | " + devMessage, - icon_url: interaction.guild!.iconURL({ - forceStatic: false, - })!, + icon_url: interaction.guild!.iconURL({ forceStatic: false, }) || undefined, }, }, ], diff --git a/src/commands/guild/top.ts b/src/commands/guild/top.ts index d018e67..10936bd 100644 --- a/src/commands/guild/top.ts +++ b/src/commands/guild/top.ts @@ -286,9 +286,7 @@ export default async function guildTop( " | " + devMessage + cacheStatusText, - icon_url: interaction.guild!.iconURL({ - forceStatic: false, - })!, + icon_url: interaction.guild!.iconURL({ forceStatic: false, }) || undefined, }, }, ], diff --git a/src/commands/staff/beast.ts b/src/commands/staff/beast.ts index d747fea..f90783f 100644 --- a/src/commands/staff/beast.ts +++ b/src/commands/staff/beast.ts @@ -261,13 +261,6 @@ export default async function beast( const hypixelExp = player.networkExp || 0 const level = hypixelLevel(hypixelExp) - const footerText = interaction.guild - ? interaction.guild.name - : interaction.user.username - const footerIcon = interaction.guild - ? interaction.guild.iconURL({ forceStatic: false }) - : interaction.user.avatarURL({ forceStatic: false }) - await interaction.editReply({ embeds: [ { @@ -284,8 +277,8 @@ export default async function beast( url: head!, }, footer: { - text: footerText + " | " + devMessage, - icon_url: footerIcon!, + text: interaction.guild!.name + " | " + devMessage, + icon_url: interaction.guild!.iconURL({ forceStatic: false }) || undefined, }, fields: statsFields, }, diff --git a/src/commands/staff/help.ts b/src/commands/staff/help.ts index a6e1150..ca9dbdc 100644 --- a/src/commands/staff/help.ts +++ b/src/commands/staff/help.ts @@ -46,12 +46,6 @@ export default async function help( } const embedColor = Number(color.replace("#", "0x")) - const footerText = interaction.guild - ? interaction.guild.name - : interaction.user.username - const footerIcon = interaction.guild - ? interaction.guild.iconURL({ forceStatic: false }) - : interaction.user.avatarURL({ forceStatic: false }) await interaction.editReply({ embeds: [ @@ -61,11 +55,11 @@ export default async function help( fields: commandList, color: embedColor, thumbnail: { - url: interaction.guild!.iconURL({ forceStatic: false })!, + url: interaction.guild!.iconURL({ forceStatic: false }) || "", }, footer: { - icon_url: footerIcon!, - text: footerText + " | " + devMessage, + icon_url: interaction.guild!.iconURL({ forceStatic: false }) || undefined, + text: interaction.guild?.name + " | " + devMessage, }, }, ],