Skip to content

Commit

Permalink
kaz edits
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane DeWael committed Mar 23, 2021
1 parent 1e4546b commit 67ec23b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
7 changes: 3 additions & 4 deletions docs/_basic/ja_listening_actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ app.action('approve_button', async ({ ack }) => {
```javascript
// action_id が 'select_user' と一致し、block_id が 'assign_ticket' と一致する場合のみミドルウェアが呼び出される
app.action({ action_id: 'select_user', block_id: 'assign_ticket' },
async ({ body, action, ack, context }) => {
async ({ body, client, ack }) => {
await ack();
try {
const result = await app.client.reactions.add({
token: context.botToken,
const result = await client.reactions.add({
name: 'white_check_mark',
timestamp: action.action_ts,
timestamp: body.message.ts,
channel: body.channel.id
});
}
Expand Down
7 changes: 3 additions & 4 deletions docs/_basic/listening_actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ You can use a constraints object to listen to `callback_id`s, `block_id`s, and `
```javascript
// Your listener function will only be called when the action_id matches 'select_user' AND the block_id matches 'assign_ticket'
app.action({ action_id: 'select_user', block_id: 'assign_ticket' },
async ({ body, action, ack, context }) => {
async ({ body, client, ack }) => {
await ack();
try {
const result = await app.client.reactions.add({
token: context.botToken,
const result = await client.reactions.add({
name: 'white_check_mark',
timestamp: action.action_ts,
timestamp: body.message.ts,
channel: body.channel.id
});
}
Expand Down
3 changes: 1 addition & 2 deletions examples/getting-started-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"build:watch": "tsc -w -p ./src",
"start": "npm run build && node dist/app.js"
},
"author": "",
"license": "ISC",
"license": "MIT",
"dependencies": {
"@slack/bolt": "^3.3.0",
"dotenv": "^8.2.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/getting-started-typescript/src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export const isGenericMessageEvent = (msg: MessageEvent): msg is GenericMessageE
}

export const isMessageItem = (item: ReactionAddedEvent["item"]): item is ReactionMessageItem => {
return (item as ReactionMessageItem).channel !== undefined;
return (item as ReactionMessageItem).type === 'message';
}

0 comments on commit 67ec23b

Please sign in to comment.