Skip to content

Commit

Permalink
Remove unused client arg and add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
misscoded committed Jan 8, 2024
1 parent ba32f53 commit 64a4174
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@ const app = new App({
socketMode: true,
appToken: process.env.SLACK_APP_TOKEN,
logLevel: LogLevel.DEBUG,
// To opt-out of using the JIT token to make `client` calls in
// function-related callbacks, set attachFunctionToken to false.
// attachFunctionToken: false,
});

/** Sample Function Listener */
app.function('sample_function', async ({ client, inputs, complete, fail }) => {
app.function('sample_function', async ({ inputs, complete, fail }) => {
try {
const { sample_input } = inputs;

// Option 1: Complete the function after business logic is run
complete({ outputs: { sample_output: sample_input } });

// Option 2: Use interactivity (e.g. sending a button) to
// complete the function only after a user takes action
// complete the function only after a user takes action.
// To use, add `client` to the callback arguments above.
// await client.chat.postMessage({
// channel: 'YOUR-CHANNEL-ID-HERE',
// blocks: [
Expand Down

0 comments on commit 64a4174

Please sign in to comment.