Skip to content

Commit c32bcb3

Browse files
Updated Server Icon on Embed.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent a168b76 commit c32bcb3

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

src/events/guildMemberUpdate.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -165,22 +165,22 @@ async function onBoostStart(member: GuildMember): Promise<void> {
165165
await safeSend(logChannel, { embeds: [logEmbed] });
166166

167167
try {
168-
const guild = await member.guild.fetch();
169168
const serverImage = guild.iconURL();
170169

171-
const container = new ContainerBuilder().addSectionComponents(comp =>
172-
comp
173-
.addTextDisplayComponents(text =>
174-
text.setContent(
175-
`## Thanks for the boost! <a:booster:1527782487349268480>\n` +
176-
`Thank you for boosting the server **${guild.name}**\n\n`+
177-
`Your support helps us unlock new server perks and continue making this community even better for everyone.\n\n`+
178-
`We truly appreciate you being part of our journey. Enjoy your booster rewards! ✨`
179-
)
170+
const container = new ContainerBuilder().addSectionComponents(comp => {
171+
comp.addTextDisplayComponents(text =>
172+
text.setContent(
173+
`## Thanks for the boost! <a:booster:1527782487349268480>\n` +
174+
`Thank you for boosting the server **${guild.name}**\n\n`+
175+
`Your support helps us unlock new server perks and continue making this community even better for everyone.\n\n`+
176+
`We truly appreciate you being part of our journey. Enjoy your booster rewards! ✨`
180177
)
181-
.setThumbnailAccessory(accessory => accessory.setURL(serverImage ? serverImage : ''))
182-
)
183-
.setAccentColor(SystemColors.main);
178+
);
179+
if (serverImage) {
180+
comp.setThumbnailAccessory(accessory => accessory.setURL(serverImage));
181+
}
182+
return comp;
183+
}).setAccentColor(SystemColors.main);
184184
await member.send({
185185
components: [container],
186186
flags: [MessageFlags.IsComponentsV2]

0 commit comments

Comments
 (0)