fix: don't fetch partial messages on delete

This commit is contained in:
Isaac 2023-01-02 13:27:20 +00:00
parent 813beb44a0
commit 0fa45e3e50
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33

View File

@ -10,15 +10,10 @@ module.exports = class extends Listener {
});
}
/**
* @param {import("discord.js").Message} oldMessage
* @param {import("discord.js").Message} message
*/
async run(message) {
/** @type {import("client")} */
const client = this.client;
if (message.partial) message.fetch().then(m => (message = m)).catch(client.log.error);
const ticket = await client.prisma.ticket.findUnique({
include: { guild: true },
where: { id: message.channel.id },