diff --git a/src/api/routes/channels/#channel_id/messages/index.ts b/src/api/routes/channels/#channel_id/messages/index.ts index 38939bb4a..151b9f202 100644 --- a/src/api/routes/channels/#channel_id/messages/index.ts +++ b/src/api/routes/channels/#channel_id/messages/index.ts @@ -514,7 +514,7 @@ router.post( ip: req.ip, userAgent: req.headers["user-agent"] as string, }); - return res.json(await Message.prototype.withSignedComponents.call(message.withSignedAttachments(sign), sign)); + return res.json(Message.prototype.withSignedComponents.call(message.withSignedAttachments(sign), sign)); }, ); diff --git a/src/gateway/listener/listener.ts b/src/gateway/listener/listener.ts index a8a29b0d5..6daa259fc 100644 --- a/src/gateway/listener/listener.ts +++ b/src/gateway/listener/listener.ts @@ -334,14 +334,12 @@ async function consume(this: WebSocket, opts: EventOpts) { }), ).attachments; if (data["components"]) { - data["components"] = ( - await Message.prototype.withSignedComponents.call( - data, - new NewUrlUserSignatureData({ - ip: this.ipAddress, - userAgent: this.userAgent, - }), - ) + data["components"] = Message.prototype.withSignedComponents.call( + data, + new NewUrlUserSignatureData({ + ip: this.ipAddress, + userAgent: this.userAgent, + }), ).components; } break; diff --git a/src/util/entities/Message.ts b/src/util/entities/Message.ts index 08a7ba58a..57fc6acf5 100644 --- a/src/util/entities/Message.ts +++ b/src/util/entities/Message.ts @@ -314,7 +314,7 @@ export class Message extends BaseClass { attachments: this.attachments?.map((attachment: Attachment) => Attachment.prototype.signUrls.call(attachment, data)), }; } - async withSignedComponents(data: NewUrlUserSignatureData) { + withSignedComponents(data: NewUrlUserSignatureData) { if (!this.components || !(this.flags & Number(MessageFlags.FLAGS.IS_COMPONENTS_V2))) return { ...this }; function signMedia(media: UnfurledMediaItem) { Object.assign(media, Attachment.prototype.signUrls.call(media, data));