Attempt to set channel/message id for attachments in more places

This commit is contained in:
Rory& committed 2026-04-18 18:26:34 +02:00
1 parent e40579fe33
commit 81d44788c6
2 files changed
+3 -1

No files matched your search

@@ -189,7 +189,7 @@ router.put(
if (req.file) {
try {
const file = await uploadFile(`/attachments/${req.params.channel_id}`, req.file);
const file = await uploadFile(`/attachments/${req.params.channel_id}/${message_id}`, req.file);
attachments.push(Attachment.create(file));
} catch (error) {
return res.status(400).json(error);
+2
View File
@@ -176,6 +176,7 @@ async function processMedia(media: UnfurledMediaItem, messageId: string, batchId
width: attEnt.width,
content_type: attEnt.contentType || attEnt.userOriginalContentType,
channel_id: channel.id,
message_id: messageId,
});
await realAtt.save();
@@ -404,6 +405,7 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> {
width: attEnt.width,
content_type: attEnt.contentType || attEnt.userOriginalContentType,
channel_id: channel.id,
message_id: message.id,
});
await realAtt.save();
return { attachment: realAtt, index: att.index };