ViewRaw: Remove less properties from author
This commit is contained in:
parent
386dfe363a
commit
ab3e993274
@ -42,22 +42,12 @@ function sortObject<T extends object>(obj: T): T {
|
|||||||
|
|
||||||
function cleanMessage(msg: Message) {
|
function cleanMessage(msg: Message) {
|
||||||
const clone = sortObject(JSON.parse(JSON.stringify(msg)));
|
const clone = sortObject(JSON.parse(JSON.stringify(msg)));
|
||||||
for (const key in clone.author) {
|
for (const key of [
|
||||||
switch (key) {
|
"email",
|
||||||
case "id":
|
"phone",
|
||||||
case "username":
|
"mfaEnabled",
|
||||||
case "usernameNormalized":
|
"personalConnectionId"
|
||||||
case "discriminator":
|
]) delete clone.author[key];
|
||||||
case "avatar":
|
|
||||||
case "bot":
|
|
||||||
case "system":
|
|
||||||
case "publicFlags":
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
// phone number, email, etc
|
|
||||||
delete clone.author[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// message logger added properties
|
// message logger added properties
|
||||||
const cloneAny = clone as any;
|
const cloneAny = clone as any;
|
||||||
|
Loading…
Reference in New Issue
Block a user