fix referencing messages

This commit is contained in:
Isaac 2022-10-11 20:12:40 +01:00
parent f7b5031aab
commit 4469aa4920
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33

View File

@ -492,6 +492,7 @@ module.exports = class TicketManager {
} catch { } catch {
this.client.log.verbose('Failed to fetch member %s of %s', message.author.id, message.guild.id); this.client.log.verbose('Failed to fetch member %s of %s', message.author.id, message.guild.id);
} }
}
await channel.send({ await channel.send({
embeds: [ embeds: [
new ExtendedEmbedBuilder() new ExtendedEmbedBuilder()
@ -515,7 +516,7 @@ module.exports = class TicketManager {
.setDescription(message.content.substring(0, 1000) + (message.content.length > 1000 ? '...' : '')), .setDescription(message.content.substring(0, 1000) + (message.content.length > 1000 ? '...' : '')),
], ],
}); });
}
} }
} }
@ -595,7 +596,8 @@ module.exports = class TicketManager {
} }
if (category.guild.archive && message) { if (category.guild.archive && message) {
const row = await this.archiver.saveMessage(ticket.id, message, true); let row = await this.client.prisma.archivedMessage.findUnique({ where: { id: message.id } });
if (!row) row = await this.archiver.saveMessage(ticket.id, message, true);
if (row) { if (row) {
await this.client.prisma.ticket.update({ await this.client.prisma.ticket.update({
data: { referencesMessageId: row.id }, data: { referencesMessageId: row.id },