Skip to content

Commit

Permalink
feat: Adding the checkmark when the ticket is Done (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
chr-tatu authored Oct 2, 2024
1 parent 3606d46 commit ee4cffc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`.";
Expand Down

0 comments on commit ee4cffc

Please sign in to comment.