Skip to content

Commit

Permalink
fix: inactivity warning spam
Browse files Browse the repository at this point in the history
  • Loading branch information
eartharoid committed May 27, 2023
1 parent c362030 commit f69bc9a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/lib/tickets/manager.js
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/listeners/client/ready.js
Expand Up @@ -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);
Expand Down

0 comments on commit f69bc9a

Please sign in to comment.