diff --git a/src/api/routes/channels/#channel_id/pins.ts b/src/api/routes/channels/#channel_id/pins.ts index 370216767..899d2d43c 100644 --- a/src/api/routes/channels/#channel_id/pins.ts +++ b/src/api/routes/channels/#channel_id/pins.ts @@ -174,7 +174,21 @@ router.get( const pins = await Message.find({ where: { channel_id: channel_id, pinned_at: Not(IsNull()) }, - relations: { author: true }, + relations: { + author: true, + webhook: true, + application: true, + mentions: true, + mention_roles: true, + mention_channels: true, + sticker_items: true, + attachments: true, + thread: { + recipients: { + user: true, + }, + }, + }, order: { pinned_at: "DESC" }, }); diff --git a/src/util/entities/Message.ts b/src/util/entities/Message.ts index 0957bcf2a..713646739 100644 --- a/src/util/entities/Message.ts +++ b/src/util/entities/Message.ts @@ -243,7 +243,7 @@ export class Message extends BaseClass { member_id: undefined, webhook_id: this.webhook_id ?? undefined, application_id: undefined, - mentions: this.mentions?.map((user) => { + mentions: this.mentions.map((user) => { if (user && !user.toPublicUser) console.trace("toPublic user missing!!!"); return user?.toPublicUser?.() ?? user ?? undefined; }),