Merge pull request #1 from MatthewStanciu/master
Add /countstatus command
This commit is contained in:
commit
a06ffde16e
1 changed files with 13 additions and 0 deletions
13
api/app.js
13
api/app.js
|
@ -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) => {
|
(async (req, res) => {
|
||||||
// Start your app
|
// Start your app
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue