Add /countstatus command

This commit is contained in:
Matthew Stanciu 2020-11-17 16:19:53 -05:00
parent 54cd1b36bc
commit 772559a2f3

View file

@ -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 {