From f69bc9a185bd4b7a73ecb827a41dd3c704a485b8 Mon Sep 17 00:00:00 2001 From: Isaac Date: Sat, 27 May 2023 21:11:03 +0100 Subject: [PATCH] fix: inactivity warning spam --- src/lib/tickets/manager.js | 1 + src/listeners/client/ready.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/tickets/manager.js b/src/lib/tickets/manager.js index 987685894..4eca9b0e0 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 ec729ef43..eb2e34313 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);