fix(logging): ignore ephemeral message updates

This commit is contained in:
Isaac 2022-10-24 18:24:53 +01:00
parent ecd23a150a
commit 0436952327
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33

View File

@ -1,4 +1,5 @@
const { Listener } = require('@eartharoid/dbf');
const { MessageFlagsBitField } = require('discord.js');
const { logMessageEvent } = require('../../lib/logging');
module.exports = class extends Listener {
@ -20,6 +21,8 @@ module.exports = class extends Listener {
const client = this.client;
if (newMessage.partial) newMessage.fetch().then(m => (newMessage = m)).catch(client.log.error);
if (newMessage.flags.has(MessageFlagsBitField.Flags.Ephemeral)) return;
const ticket = await client.prisma.ticket.findUnique({
include: { guild: true },
where: { id: newMessage.channel.id },