From 14a0f0f1a095b03a396e29d384866fb6763d4494 Mon Sep 17 00:00:00 2001 From: Navy Date: Tue, 22 Jun 2021 00:53:00 +0300 Subject: [PATCH] don't send reminder when no modmail in q --- structure/Modmail.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/structure/Modmail.js b/structure/Modmail.js index 70a5cd6..8809b18 100644 --- a/structure/Modmail.js +++ b/structure/Modmail.js @@ -357,11 +357,13 @@ class Modmail { const channel = this.reminderChannel; const amount = this.queue.length; - let str = ''; - if (!amount) str = 'No modmail in queue'; - else str = `${amount} modmail in queue.`; + if (!amount) { + if (this.lastReminder) await this.lastReminder.delete(); + return; + } + const str = `${amount} modmail in queue.`; this.client.logger.debug(`Sending modmail reminder, #mm: ${amount}`); if (this.lastReminder) { if (channel.lastMessage.id === this.lastReminder.id) return this.lastReminder.edit(str);