Merge pull request #1 from MatthewStanciu/master

Add /countstatus command
This commit is contained in:
Avi 2020-11-18 14:46:20 -08:00 committed by GitHub
commit a06ffde16e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -201,6 +201,19 @@ 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 {