From 2897d000cc9f8639510a777080899a71a73adadd Mon Sep 17 00:00:00 2001 From: Lea Date: Wed, 15 Mar 2023 16:54:41 +0100 Subject: [PATCH] Display username in message log --- bot/src/bot/modules/mod_logs.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/bot/src/bot/modules/mod_logs.ts b/bot/src/bot/modules/mod_logs.ts index 8126117..3794db5 100644 --- a/bot/src/bot/modules/mod_logs.ts +++ b/bot/src/bot/modules/mod_logs.ts @@ -31,17 +31,22 @@ client.on('packet', async (packet) => { const attachFullMessage = oldMsg.length > 800 || newMsg.length > 800; let embed: LogMessage = { title: `Message edited in ${server.name}`, - description: `[\\[#${channel.name}\\]](/server/${server._id}/channel/${channel._id}) | ` - + `[\\[Author\\]](/@${m?.author_id}) | ` - + `[\\[Jump to message\\]](/server/${server._id}/channel/${channel._id}/${packet.id})`, + description: + `[#${channel.name}](/server/${server._id}/channel/${channel._id}) | ` + + `[@${sanitizeMessageContent( + m?.author?.username ?? "Unknown User" + )}](/@${m?.author_id}) | ` + + `[Jump to message](/server/${server._id}/channel/${channel._id}/${packet.id})`, fields: [], - color: '#829dff', + color: "#829dff", overrides: { discord: { - description: `Author: @${m?.author?.username || m?.author_id || "Unknown"} | Channel: ${channel?.name || channel?._id}` + description: `Author: @${ + m?.author?.username || m?.author_id || "Unknown" + } | Channel: ${channel?.name || channel?._id}`, }, - } - } + }, + }; if (attachFullMessage) { embed.attachments = [