mirror of
https://github.com/spacebarchat/server.git
synced 2026-07-25 23:21:25 +00:00
Drop a bunch of random overrides
This commit is contained in:
@@ -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());
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user