From c718da5e9898983379d2e3e081f5598fda17614a 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 f842a3a55..ded8642ae 100644 --- a/src/api/routes/channels/#channel_id/messages/index.ts +++ b/src/api/routes/channels/#channel_id/messages/index.ts @@ -506,7 +506,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 e758849b0..6b261ccc4 100644 --- a/src/gateway/listener/listener.ts +++ b/src/gateway/listener/listener.ts @@ -353,14 +353,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 cd89c6e2e..1fb417a59 100644 --- a/src/util/entities/Message.ts +++ b/src/util/entities/Message.ts @@ -315,7 +315,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));