diff --git a/src/lib/tickets/manager.js b/src/lib/tickets/manager.js index 9876858..4eca9b0 100644 --- a/src/lib/tickets/manager.js +++ b/src/lib/tickets/manager.js @@ -1159,6 +1159,7 @@ module.exports = class TicketManager { closedBy = null, reason = null, }) { + if (this.$stale.has(ticketId)) this.$stale.delete(ticketId); let ticket = await this.getTicket(ticketId); const getMessage = this.client.i18n.getLocale(ticket.guild.locale); this.$count.categories[ticket.categoryId].total -= 1; diff --git a/src/listeners/client/ready.js b/src/listeners/client/ready.js index ec729ef..eb2e343 100644 --- a/src/listeners/client/ready.js +++ b/src/listeners/client/ready.js @@ -186,7 +186,7 @@ module.exports = class extends Listener { // set inactive tickets as stale for (const guild of guilds) { for (const ticket of guild.tickets) { - // if (ticket.lastMessageAt && ticket.lastMessageAt < Date.now() - guild.staleAfter) + if (client.tickets.$stale.has(ticket.id)) continue; if (ticket.lastMessageAt && Date.now() - ticket.lastMessageAt > guild.staleAfter) { /** @type {import("discord.js").TextChannel} */ const channel = client.channels.cache.get(ticket.id);