From 80fe4764cf6a6af46352e7f83fe8c454c4a38c3a Mon Sep 17 00:00:00 2001 From: MathMan05 Date: Thu, 26 Feb 2026 14:52:04 -0600 Subject: [PATCH] it ain't async --- .../routes/channels/#channel_id/messages/index.ts | 2 +- src/gateway/listener/listener.ts | 14 ++++++-------- src/util/entities/Message.ts | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) 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));