From ab3e9932749d3d5a226cb08906f5c8335d9581c5 Mon Sep 17 00:00:00 2001 From: V Date: Tue, 13 Jun 2023 02:23:06 +0200 Subject: [PATCH] ViewRaw: Remove less properties from author --- src/plugins/viewRaw.tsx | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/plugins/viewRaw.tsx b/src/plugins/viewRaw.tsx index eb0c3528..9f13db97 100644 --- a/src/plugins/viewRaw.tsx +++ b/src/plugins/viewRaw.tsx @@ -42,22 +42,12 @@ function sortObject(obj: T): T { function cleanMessage(msg: Message) { const clone = sortObject(JSON.parse(JSON.stringify(msg))); - for (const key in clone.author) { - switch (key) { - case "id": - case "username": - case "usernameNormalized": - case "discriminator": - case "avatar": - case "bot": - case "system": - case "publicFlags": - break; - default: - // phone number, email, etc - delete clone.author[key]; - } - } + for (const key of [ + "email", + "phone", + "mfaEnabled", + "personalConnectionId" + ]) delete clone.author[key]; // message logger added properties const cloneAny = clone as any;