From 772559a2f3a3aeab92b9f0420e0bc9375d779792 Mon Sep 17 00:00:00 2001 From: Matthew Stanciu Date: Tue, 17 Nov 2020 16:19:53 -0500 Subject: [PATCH 1/3] Add /countstatus command --- api/app.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/api/app.js b/api/app.js index a87ad02..343a139 100644 --- a/api/app.js +++ b/api/app.js @@ -201,6 +201,20 @@ app.event('message', async (body) => { } }); +app.command('/countstatus', async ({ command, ack, respond }) => { + await ack() + const { text, user_id } = command + const channel = 'CDJMS683D' + + let oldest = await fetchOldest(channel); + let latest = await fetchLatest(channel); + + await respond({ + text: `The day's current progress is *${latest - oldest}*!`, + response_type: 'ephemeral' + }) +}); + (async (req, res) => { // Start your app try { From 77b854ab4f7e57b988941020a5403ba9b4d9edd5 Mon Sep 17 00:00:00 2001 From: Matthew Stanciu Date: Tue, 17 Nov 2020 16:24:12 -0500 Subject: [PATCH 2/3] clean up --- api/app.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/api/app.js b/api/app.js index 343a139..7f2f6c6 100644 --- a/api/app.js +++ b/api/app.js @@ -203,11 +203,10 @@ app.event('message', async (body) => { app.command('/countstatus', async ({ command, ack, respond }) => { await ack() - const { text, user_id } = command const channel = 'CDJMS683D' - let oldest = await fetchOldest(channel); - let latest = await fetchLatest(channel); + let oldest = await fetchOldest(channel) + let latest = await fetchLatest(channel) await respond({ text: `The day's current progress is *${latest - oldest}*!`, From 46cd41d6428dc2e3606f45ae1f175f0159708e04 Mon Sep 17 00:00:00 2001 From: Avi <32148378+abby9664@users.noreply.github.com> Date: Wed, 9 Dec 2020 16:16:39 -0800 Subject: [PATCH 3/3] Revert "Add /countstatus command" --- api/app.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/api/app.js b/api/app.js index 7f2f6c6..a87ad02 100644 --- a/api/app.js +++ b/api/app.js @@ -201,19 +201,6 @@ app.event('message', async (body) => { } }); -app.command('/countstatus', async ({ command, ack, respond }) => { - await ack() - const channel = 'CDJMS683D' - - let oldest = await fetchOldest(channel) - let latest = await fetchLatest(channel) - - await respond({ - text: `The day's current progress is *${latest - oldest}*!`, - response_type: 'ephemeral' - }) -}); - (async (req, res) => { // Start your app try {