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

This commit is contained in:
Rory&
2026-04-17 01:00:51 +02:00
parent e40579fe33
commit 81d44788c6
2 changed files with 3 additions and 1 deletions

View File

@@ -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);

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 };