Add message reference (for replies) to archives

This commit is contained in:
Isaac 2022-10-11 18:58:02 +01:00
parent 54506cf422
commit f7b5031aab
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33

View File

@ -96,6 +96,9 @@ module.exports = class TicketArchiver {
}); });
} }
let reference;
if (message.reference) reference = await message.fetchReference();
const messageD = { const messageD = {
author: { author: {
connect: { connect: {
@ -111,6 +114,7 @@ module.exports = class TicketArchiver {
components: [...message.components.values()], components: [...message.components.values()],
content: message.content, content: message.content,
embeds: message.embeds.map(embed => ({ ...embed })), embeds: message.embeds.map(embed => ({ ...embed })),
reference: reference ? reference.id : null,
}), }),
), ),
createdAt: message.createdAt, createdAt: message.createdAt,