Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/_advanced/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ async function addTimezoneContext ({ payload, context, next }) {
context.tz_offset = user.tz_offset;
}

app.command('request', addTimezoneContext, async ({ command, context }) => {
app.command('request', addTimezoneContext, async ({ command, ack, context }) => {
// Acknowledge command request
ack();
// Get local hour of request
const local_hour = (Date.UTC() + context.tz_offset).getHours();

Expand Down
5 changes: 4 additions & 1 deletion docs/_basic/listening_responding_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ Similar to actions, there are two ways to respond to slash command requests. The

```javascript
// The echo command simply echoes on command
app.command('/echo', async ({ command, say }) => {
app.command('/echo', async ({ command, ack, say }) => {
// Acknowledge command request
ack();

say(`${command.text}`);
});
```