Skip to content

Commit

Permalink
chore(deps): bump @slack/bolt from 3.22.0 to 4.2.0 in /examples/socke…
Browse files Browse the repository at this point in the history
…t-mode (#2399)
  • Loading branch information
dependabot[bot] authored Jan 10, 2025
1 parent 3abfb65 commit 0d56071
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
21 changes: 10 additions & 11 deletions examples/socket-mode/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const clientOptions = {
const app = new App({
// receiver: socketModeReceiver,
token: process.env.SLACK_BOT_TOKEN, //disable this if enabling OAuth in socketModeReceiver
// logLevel: LogLevel.DEBUG,
clientOptions,
appToken: process.env.SLACK_APP_TOKEN,
socketMode: true,
Expand All @@ -34,7 +33,7 @@ const app = new App({

(async () => {
await app.start();
console.log('⚡️ Bolt app started');
app.logger.info('⚡️ Bolt app started');
})();

// Publish a App Home
Expand All @@ -58,15 +57,15 @@ app.event('app_home_opened', async ({ event, client }) => {
});

// Message Shortcut example
app.shortcut('launch_msg_shortcut', async ({ shortcut, body, ack, context, client }) => {
app.shortcut('launch_msg_shortcut', async ({ shortcut, body, ack, context, client, logger }) => {
await ack();
console.log(shortcut);
logger.info(shortcut);
});

// Global Shortcut example
// setup global shortcut in App config with `launch_shortcut` as callback id
// add `commands` scope
app.shortcut('launch_shortcut', async ({ shortcut, body, ack, context, client }) => {
app.shortcut('launch_shortcut', async ({ shortcut, body, ack, context, client, logger }) => {
try {
// Acknowledge shortcut request
await ack();
Expand Down Expand Up @@ -105,13 +104,13 @@ app.shortcut('launch_shortcut', async ({ shortcut, body, ack, context, client })
},
});
} catch (error) {
console.error(error);
logger.error(error);
}
});

// subscribe to 'app_mention' event in your App config
// need app_mentions:read and chat:write scopes
app.event('app_mention', async ({ event, context, client, say }) => {
app.event('app_mention', async ({ event, context, client, logger, say }) => {
try {
await say({
blocks: [
Expand All @@ -135,7 +134,7 @@ app.event('app_mention', async ({ event, context, client, say }) => {
],
});
} catch (error) {
console.error(error);
logger.error(error);
}
});

Expand Down Expand Up @@ -168,9 +167,9 @@ app.message('hello', async ({ message, say }) => {
});

// Listen and respond to button click
app.action('first_button', async ({ action, ack, say, context }) => {
console.log('button clicked');
console.log(action);
app.action('first_button', async ({ action, ack, say, context, logger }) => {
logger.info('button clicked');
logger.info(action);
// acknowledge the request right away
await ack();
await say('Thanks for clicking the fancy button');
Expand Down
2 changes: 1 addition & 1 deletion examples/socket-mode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"author": "Slack Technologies, LLC",
"license": "MIT",
"dependencies": {
"@slack/bolt": "^3.2.0"
"@slack/bolt": "^4.2.0"
}
}

0 comments on commit 0d56071

Please sign in to comment.