Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to catch app_home_opened event #8

Open
naoking158 opened this issue Aug 31, 2022 · 0 comments
Open

Unable to catch app_home_opened event #8

naoking158 opened this issue Aug 31, 2022 · 0 comments

Comments

@naoking158
Copy link

SSIA

Reproduce

import "https://deno.land/x/dotenv@v2.0.0/load.ts";
import { App, LogLevel } from "https://deno.land/x/slack_bolt@1.0.0/mod.ts";

const app = new App({
  token: Deno.env.get("SLACK_BOT_TOKEN"),
  appToken: Deno.env.get("SLACK_APP_TOKEN"),
  socketMode: true,
  logLevel: LogLevel.DEBUG,
  ignoreSelf: true,
});

app.event("app_home_opened", async ({ event, client, logger }) => {
  logger.info("In app home opened");
  try {
    const result = await client.views.publish({
      user_id: event.user,
      view: {
        "type": "home",
        "blocks": [
          {
            "type": "section",
            "text": {
              "type": "mrkdwn",
              "text": `*Welcome home, <@${event.user}> :house:*`,
            },
          },
        ],
      },
    });
    logger.info(result);
  } catch (error) {
    logger.error(error);
  }
});

await app.start();
console.log("Bolt app is runnning");

Result

When I open App Home in Slack, I only get the following log output.

[DEBUG]  socket-mode:SocketModeClient:0 received a message on the WebSocket
[DEBUG]  socket-mode:SocketModeClient:0 calling ack events_api
[DEBUG]  socket-mode:SocketModeClient:0 send() in state: connected,ready
[DEBUG]  socket-mode:SocketModeClient:0 sending message on websocket: {"envelope_id":"f6d38bb7-6712-4278-9eaf-...","payload":{}}

Expected

When I open App Home in Slack, App Home is updated and the following comment is printed in console.

In app home opened

Environment

Versions

deno 1.23.1 (release, aarch64-apple-darwin)
v8 10.4.132.8
typescript 4.7.2

manifest.yml

display_information:
...
features:
  app_home:
    home_tab_enabled: true
    messages_tab_enabled: false
    messages_tab_read_only_enabled: true
  bot_user:
    display_name: VMOperateTool
    always_online: false
  shortcuts:
    ...
  slash_commands:
    ...
oauth_config:
  scopes:
    bot:
      - channels:history
      - chat:write
      - commands
      - groups:history
      - im:history
      - incoming-webhook
      - channels:read
settings:
  event_subscriptions:
    bot_events:
      - app_home_opened
      - message.channels
      - message.groups
      - message.im
  interactivity:
    is_enabled: true
  org_deploy_enabled: false
  socket_mode_enabled: true
  token_rotation_enabled: false
@naoking158 naoking158 changed the title Unable to catch app_home_opened event Unable to catch app_home_opened event Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant