From cc80825968e5a4f89ac4befb814cada3cb62326d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2025 00:14:03 +0000 Subject: [PATCH 1/3] chore(deps): bump @slack/bolt in /examples/socket-mode Bumps [@slack/bolt](https://github.com/slackapi/bolt-js) from 3.22.0 to 4.2.0. - [Release notes](https://github.com/slackapi/bolt-js/releases) - [Commits](https://github.com/slackapi/bolt-js/compare/@slack/bolt@3.22.0...@slack/bolt@4.2.0) --- updated-dependencies: - dependency-name: "@slack/bolt" dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- examples/socket-mode/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/socket-mode/package.json b/examples/socket-mode/package.json index 52a889ac8..c021e5945 100644 --- a/examples/socket-mode/package.json +++ b/examples/socket-mode/package.json @@ -10,6 +10,6 @@ "author": "Slack Technologies, LLC", "license": "MIT", "dependencies": { - "@slack/bolt": "^3.2.0" + "@slack/bolt": "^4.2.0" } } From fb2cc3ca16a389b7f9707a752c101e9d98d5a107 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Thu, 9 Jan 2025 16:29:41 -0800 Subject: [PATCH 2/3] refactor: replace console logs with app logger outputs --- examples/socket-mode/app.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/socket-mode/app.js b/examples/socket-mode/app.js index 174764880..258a66da5 100644 --- a/examples/socket-mode/app.js +++ b/examples/socket-mode/app.js @@ -34,7 +34,7 @@ const app = new App({ (async () => { await app.start(); - console.log('⚡️ Bolt app started'); + app.logger.info('⚡️ Bolt app started'); })(); // Publish a App Home @@ -58,15 +58,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(); @@ -105,13 +105,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: [ @@ -135,7 +135,7 @@ app.event('app_mention', async ({ event, context, client, say }) => { ], }); } catch (error) { - console.error(error); + logger.error(error); } }); @@ -168,9 +168,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'); From a5097e3e9a412f1dd4d56f97d82ece99aa54157b Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Thu, 9 Jan 2025 16:29:58 -0800 Subject: [PATCH 3/3] style: remove a commented log level attribute repeated below --- examples/socket-mode/app.js | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/socket-mode/app.js b/examples/socket-mode/app.js index 258a66da5..3ef3ae802 100644 --- a/examples/socket-mode/app.js +++ b/examples/socket-mode/app.js @@ -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,