Drop a bunch of random overrides

This commit is contained in:
Rory&
2026-07-15 12:03:47 +02:00
parent 86ab110abd
commit 188a3dc2b8
2 changed files with 2 additions and 22 deletions
@@ -98,27 +98,7 @@ router.patch(
} satisfies MessageUpdateEvent);
postHandleMessage(new_message).catch((e) => console.error("[Message] post-message handler failed", e));
// TODO: a DTO?
return res.json({
...new_message.toJSON(),
id: new_message.id,
type: new_message.type,
channel_id: new_message.channel_id!,
// member: new_message.member?.toPublicMember(), // TODO: why was this here? this isnt in the Message object lol
author: new_message.author!.toPartialUser(),
attachments: new_message.attachments?.map((x) => x.toJSON()) ?? [],
embeds: new_message.embeds,
mentions: new_message.mentions?.map((u) => u.toPartialUser()) ?? [],
mention_roles: new_message.mention_roles?.map((r) => r.id) ?? [],
mention_everyone: new_message.mention_everyone ?? false,
pinned: new_message.pinned,
timestamp: new_message.timestamp.toISOString(),
edited_timestamp: new_message.edited_timestamp?.toISOString() ?? null,
// these are not in the Discord.com response
mention_channels: new_message.mention_channels.map((x) => x.toJSON()),
} satisfies PublicMessage);
return res.json(new_message.toJSON());
},
);
+1 -1
View File
@@ -349,7 +349,7 @@ export class Message extends BaseClass {
message_reference: this.message_reference ?? undefined,
mention_everyone: this.mention_everyone ?? false,
author: {
...(this.author?.toPublicUser() ?? undefined),
...(this.author?.toPartialUser() ?? undefined),
// Webhooks
username: this.username ?? this.author?.username ?? null,
avatar: this.avatar ?? this.author?.avatar ?? null,