Summary
I have a very simple BoltJS app deployed to a very simple GCP Cloud Run service, but I can't Slack to trigger the BoltJS app via sending a message to a Slack channel.
Setup
Below is my setup.
Code
Index.ts (bolt)
import { App } from "@slack/bolt";
import { config } from "dotenv";
// config dotenv
config();
const app = new App({
token: process.env.SLACK_BOT_TOKEN,
signingSecret: process.env.SLACK_SIGNING_SECRET
});
// listen to all messages
app.message(/.+/, async ({ message, say }) => {
console.log(`message: ${JSON.stringify(message)}`);
});
// Start your app
(async () => {
await app.start(process.env.PORT || 3000);
console.log("⚡️ Bolt app is running!");
})();
GCP Cloud Run
I deploy my app to Cloud Run with a very standard Dockerfile.
Slack Config
- The signing secret from Basic Information is configured in GCP correctly
- The Bot User Auth Token from Install App is configured in GCP correctly
- The App is installed to the Workspace
- Enable Events is switched ON in Event Subscriptions
- The Request URL is configured as
https://<my-cloud-run-url>/slack/events
- Subscribe to bot events includes
message.channels
- ALL Bot Token Scopes have been added
Results
When I deploy a new version of my app to Cloud Run, the deployment completes successfully.
In the LOGS for the Cloud Run service, I see the following, which is triggered by the iife that starts my app in index.ts
:
⚡️ Bolt app is running!
MAIN PROBLEM
If I type something in a public channel and hit Enter
, I check the logs again, but nothing shows up.
I expect to see a log that shows the message that was just sent, but instead I see no logs.