it ain't async

This commit is contained in:
MathMan05
2026-03-20 16:31:32 +01:00
committed by Rory&
parent 2ff656ef03
commit c718da5e98
3 changed files with 8 additions and 10 deletions
@@ -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));
},
);
+6 -8
View File
@@ -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;
+1 -1
View File
@@ -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));