ViewRaw: Remove less properties from author

This commit is contained in:
V 2023-06-13 02:23:06 +02:00
parent 386dfe363a
commit ab3e993274
No known key found for this signature in database
GPG Key ID: A1DC0CFB5615D905

View File

@ -42,22 +42,12 @@ function sortObject<T extends object>(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;