Add /countstatus command
This commit is contained in:
parent
54cd1b36bc
commit
772559a2f3
1 changed files with 14 additions and 0 deletions
14
api/app.js
14
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 {
|
||||
|
|
Loading…
Reference in a new issue