From 0da5ef52132f0cb4d9997762ae8a3922c4df1d41 Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Tue, 10 Jan 2023 05:31:21 +1100 Subject: [PATCH] revamp nickname log --- src/events/guildMemberUpdate.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/events/guildMemberUpdate.ts b/src/events/guildMemberUpdate.ts index dd83977..9e60243 100644 --- a/src/events/guildMemberUpdate.ts +++ b/src/events/guildMemberUpdate.ts @@ -6,10 +6,12 @@ export default { if (!client.config.botSwitches.logs) return; const channel = (client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel) if (oldMember.nickname != newMember.nickname){ - const embed = new client.embed().setColor(client.config.embedColor).setTimestamp().setThumbnail(newMember.user.displayAvatarURL({size: 2048})).setTitle(`Nickname updated: ${newMember.user.tag}`).setDescription(`<@${newMember.user.id}>\n\`${newMember.user.id}\``).addFields( - {name: '🔹 Old nickname', value: `\`\`\`${oldMember.nickname == null ? ' ' : oldMember.nickname}\`\`\``}, - {name: '🔹 New nickname', value: `\`\`\`${newMember.nickname == null ? ' ' : newMember.nickname}\`\`\``} - ); + const embed = new client.embed().setColor(client.config.embedColor).setTimestamp().setThumbnail(newMember.user.displayAvatarURL({size: 2048})).setTitle(`Nickname updated: ${newMember.user.tag}`).setDescription(`<@${newMember.user.id}>\n\`${newMember.user.id}\``)/*.addFields( + {name: '🔹 Old nickname', value: oldMember.nickname == null ? 'No nickname' : `\`\`\`${oldMember.nickname}\`\`\``}, + {name: '🔹 New nickname', value: newMember.nickname == null ? 'No nickname' : `\`\`\`${newMember.nickname}\`\`\``} + );*/ + oldMember.nickname == null ? '' : embed.addFields({name: '🔹 Old nickname', value: `\`\`\`${oldMember.nickname}\`\`\``}) + newMember.nickname == null ? '' : embed.addFields({name: '🔹 New nickname', value: `\`\`\`${newMember.nickname}\`\`\``}) channel.send({embeds: [embed]}) }