From ee4cffc1ab0d091dc84a47541e99729ed4e730a7 Mon Sep 17 00:00:00 2001 From: Christian Tatu <65356484+chr-tatu@users.noreply.github.com> Date: Wed, 2 Oct 2024 14:27:43 +0200 Subject: [PATCH] feat: Adding the checkmark when the ticket is Done (#174) --- app.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app.js b/app.js index cc76271..fd4c4f6 100644 --- a/app.js +++ b/app.js @@ -94,11 +94,10 @@ async function hasCheckmarkReaction({ client, channel, timestamp }) { } async function processThreadMessagesForGratitude(client, event) { - if (event.user !== event.parent_user_id) return; if (await hasCheckmarkReaction({ client, channel: event.channel, timestamp: event.thread_ts })) return; const text = event.text.toLowerCase(); - if (text === "solved") { + if (text === "solved" || text.endsWith(" has been updated to `done`.")) { await addCheckmarkReaction({ client, channel: event.channel, timestamp: event.thread_ts }); } else if (/thank|^ty|solved/.test(text)) { const reminderMessage = "Mark this thread as solved by clicking the button or replying `solved`.";