From 584ef8cc807c47e85be995fbafb937ab3cf9b2f6 Mon Sep 17 00:00:00 2001 From: Taken Date: Sun, 7 Jan 2024 17:18:31 +0100 Subject: [PATCH 1/3] 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, }, }, ], From 8009e6d8f767eb4380c691588268bb328a4dd2f1 Mon Sep 17 00:00:00 2001 From: Taken Date: Sun, 7 Jan 2024 17:24:27 +0100 Subject: [PATCH 2/3] Updated all eventt file embed reply prefs --- src/events/cron/weeklyGexp.ts | 2 +- src/events/server/guildMemberAdd/logNewJoins.ts | 4 ++++ src/events/server/voiceStateUpdate/vcJoinLeave.ts | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/events/cron/weeklyGexp.ts b/src/events/cron/weeklyGexp.ts index 0ade5ee..7992224 100644 --- a/src/events/cron/weeklyGexp.ts +++ b/src/events/cron/weeklyGexp.ts @@ -116,7 +116,7 @@ async function guildWeekly() { timestamp: new Date().toISOString(), footer: { text: channel.guild.name + " | " + devMessage, - icon_url: channel.guild.iconURL({ forceStatic: false })!, + icon_url: channel.guild.iconURL({ forceStatic: false }) || undefined, }, }, ], diff --git a/src/events/server/guildMemberAdd/logNewJoins.ts b/src/events/server/guildMemberAdd/logNewJoins.ts index 5642e50..2f379d1 100644 --- a/src/events/server/guildMemberAdd/logNewJoins.ts +++ b/src/events/server/guildMemberAdd/logNewJoins.ts @@ -22,8 +22,12 @@ export = { "Account created: " + member.user.createdAt.toLocaleString(), color: embedColor, + thumbnail: { + url: member.user.avatarURL({ forceStatic: false }) || "", + }, footer: { text: "ID: " + member.id, + icon_url: member.user.avatarURL({ forceStatic: false }) || undefined, }, timestamp: new Date().toISOString(), }, diff --git a/src/events/server/voiceStateUpdate/vcJoinLeave.ts b/src/events/server/voiceStateUpdate/vcJoinLeave.ts index 530dc6c..4b01b5e 100644 --- a/src/events/server/voiceStateUpdate/vcJoinLeave.ts +++ b/src/events/server/voiceStateUpdate/vcJoinLeave.ts @@ -32,6 +32,7 @@ export = { color: embedColor, footer: { text: "ID: " + newState.member!.id, + icon_url: newState.member!.user.avatarURL({ forceStatic: false }) || undefined, }, timestamp: new Date().toISOString(), }, @@ -49,6 +50,7 @@ export = { color: embedColor, footer: { text: "ID: " + oldState.member!.id, + icon_url: oldState.member!.user.avatarURL({ forceStatic: false }) || undefined, }, timestamp: new Date().toISOString(), }, @@ -70,6 +72,7 @@ export = { color: embedColor, footer: { text: "ID: " + oldState.member!.id, + icon_url: oldState.member!.user.avatarURL({ forceStatic: false }) || undefined, }, timestamp: new Date().toISOString(), }, From 952aa4bdd02c07e8e8fc4583adc2ce4059bdfe24 Mon Sep 17 00:00:00 2001 From: Taken Date: Sun, 7 Jan 2024 17:29:16 +0100 Subject: [PATCH 3/3] Updated modal output embed prefs --- src/components/modals/denyreasonbox.ts | 4 ++-- src/components/modals/staffdenyreasonbox.ts | 4 ++-- src/components/modals/verifyModal.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/modals/denyreasonbox.ts b/src/components/modals/denyreasonbox.ts index 9caba32..7be2193 100644 --- a/src/components/modals/denyreasonbox.ts +++ b/src/components/modals/denyreasonbox.ts @@ -83,9 +83,9 @@ export = { "`", ) .setColor(embedColor) - .setThumbnail(guild.iconURL()) + .setThumbnail(guild.iconURL({ forceStatic: false }) || "") .setFooter({ - iconURL: guild.iconURL()!, + iconURL: guild.iconURL({ forceStatic: false }) || undefined, text: "ID: " + applicantId, }) diff --git a/src/components/modals/staffdenyreasonbox.ts b/src/components/modals/staffdenyreasonbox.ts index 10e5460..bdec733 100644 --- a/src/components/modals/staffdenyreasonbox.ts +++ b/src/components/modals/staffdenyreasonbox.ts @@ -70,10 +70,10 @@ export = { "`", color: embedColor, thumbnail: { - url: applicant.avatarURL() || guild!.iconURL()!, + url: applicant.avatarURL({ forceStatic: false }) || "", }, footer: { - icon_url: guild!.iconURL()!, + icon_url: guild!.iconURL({ forceStatic: false }) || undefined, text: "ID: " + applicant.id, }, }, diff --git a/src/components/modals/verifyModal.ts b/src/components/modals/verifyModal.ts index 0fdcae4..f0597d3 100644 --- a/src/components/modals/verifyModal.ts +++ b/src/components/modals/verifyModal.ts @@ -184,7 +184,7 @@ export = { url: head!, }, footer: { - icon_url: interaction.guild!.iconURL()!, + icon_url: interaction.guild!.iconURL({ forceStatic: false }) || undefined, text: interaction.guild!.name + " | " + devMessage, }, },