From 13ead1f086d4015375f0d31ddf533ff74b7e16c2 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Wed, 31 Jan 2024 23:45:35 +1100 Subject: [PATCH] Fix up embed formatting --- src/events/guildBanAdd.ts | 6 ++++-- src/events/guildMemberRemove.ts | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/events/guildBanAdd.ts b/src/events/guildBanAdd.ts index 529bd51..3517b8d 100644 --- a/src/events/guildBanAdd.ts +++ b/src/events/guildBanAdd.ts @@ -7,9 +7,11 @@ export default class GuildBanAdd { if (!banLog) return console.log(`Member was banned from ${member.guild.name} but no audit log for this member.`) const {executor, target, reason } = banLog; if (target.id === member.user.id) { - const embed = new client.embed().setColor(client.config.embedColorRed).setTimestamp().setThumbnail(member.user.displayAvatarURL({size: 2048})).setTitle(`Member Banned: ${target.username}`).setDescription(`🔹 **User**\n<@${target.id}>\n\`${target.id}\``).addFields( + const embed = new client.embed().setColor(client.config.embedColorRed).setTimestamp().setThumbnail(member.user.displayAvatarURL({size: 2048})) + .setTitle(`Member Banned: ${target.username}`).addFields( + {name: '🔹 User', value: `<@${target.id}>\n\`${target.id}\``}, {name: '🔹 Moderator', value: `<@${executor.id}>\n\`${executor.id}\``}, - {name: '🔹 Reason', value: `${reason === null ? 'Reason unspecified': reason}`} + {name: '🔹 Reason', value: reason === null ? 'Reason unspecified': reason} ); if (!await client.userLevels.fetchUser(member.user.id)) embed.setFooter({text: 'Rank data has been wiped.'}); (client.channels.resolve(client.config.dcServer.channels.logs) as Discord.TextChannel).send({embeds: [embed]}) diff --git a/src/events/guildMemberRemove.ts b/src/events/guildMemberRemove.ts index fb249f1..8ce1743 100644 --- a/src/events/guildMemberRemove.ts +++ b/src/events/guildMemberRemove.ts @@ -8,7 +8,9 @@ export default class GuildMemberRemove { let isBot = 'Bot'; if (!member.user.bot) isBot = 'Member'; const levelData = await client.userLevels.fetchUser(member.id); - const embed = new client.embed().setColor(client.config.embedColorRed).setTimestamp().setThumbnail(member.user.displayAvatarURL({size: 2048}) as string).setTitle(`${isBot} Left: ${member.user.username}`).setDescription(`<@${member.user.id}>\n\`${member.user.id}\``).addFields( + const embed = new client.embed().setColor(client.config.embedColorRed).setTimestamp().setThumbnail(member.user.displayAvatarURL({size: 2048}) as string) + .setTitle(`${isBot} Left: ${member.user.username}`).addFields( + {name: '🔹 User', value: `<@${member.user.id}>\n\`${member.user.id}\``}, {name: '🔹 Account Creation Date', value: `\n`}, {name: '🔹 Server Join Date', value: `\n`}, {name: `🔹 Roles: ${member.roles.cache.size - 1}`, value: `${member.roles.cache.size > 1 ? member.roles.cache.filter((x)=>x.id !== member.guild.roles.everyone.id).sort((a,b)=>b.position - a.position).map(x=>x).join(member.roles.cache.size > 4 ? ' ' : '\n').slice(0,1024) : 'No roles'}`, inline: true}