fix: don't close tickets twice

This commit is contained in:
Isaac 2023-02-09 16:52:29 +00:00
parent 0b44465024
commit a73cc2bdd4
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33

View File

@ -18,7 +18,7 @@ module.exports = class extends Listener {
where: { id: channel.id },
});
if (!ticket?.open) return;
if (!ticket || ticket.open) return;
await client.tickets.finallyClose(ticket.id, { reason: 'channel deleted' });
this.client.log.info(`Closed ticket ${ticket.id} because the channel was deleted`);