Git Product home page Git Product logo

Comments (3)

travishoop avatar travishoop commented on August 21, 2024 1

The data I was looking for is in the body argument of the event callback function. This is documented here: https://slack.dev/bolt-js/reference#listener-function-arguments-listener-function-arguments

from bolt-js.

srajiang avatar srajiang commented on August 21, 2024

Hi @travishoop - You're not receiving an event_id as described here? I see here that the event is a separate field and does not contain the event id. I wonder if that's what you're seeing when you inspect the event argument passed to the listener by bolt. What happens if you declare payload and look at it's contexts>

from bolt-js.

travishoop avatar travishoop commented on August 21, 2024

These are the values I get back:

Received Message Event with values
 message
 {
  client_msg_id: '1043f866-380c-4dd0-acf2-dd9091e81d58',
  type: 'message',
  text: 'this is a test message I am sending to a public channel',
  user: 'U04L3ME6VMY',
  ts: '1708725482.598159',
  blocks: [ { type: 'rich_text', block_id: 'CTnf8', elements: [Array] } ],
  team: 'T03NC3TG00J',
  channel: 'C04LQVA1Z2P',
  event_ts: '1708725482.598159',
  channel_type: 'channel'
}  context
 {
  userToken: 'xoxp-<redacted>',
  teamId: 'T03NC3TG00J',
  botToken: 'xoxb-<redacted>',
  botId: 'B06E96VAW84',
  botUserId: 'U06E043Q48N',
  userId: 'U04L3ME6VMY',
  isEnterpriseInstall: false,
  retryNum: 2,
  retryReason: 'http_timeout',
  updateConversation: [Function (anonymous)]
} event
 {
  client_msg_id: '1043f866-380c-4dd0-acf2-dd9091e81d58',
  type: 'message',
  text: 'this is a test message I am sending to a public channel',
  user: 'U04L3ME6VMY',
  ts: '1708725482.598159',
  blocks: [ { type: 'rich_text', block_id: 'CTnf8', elements: [Array] } ],
  team: 'T03NC3TG00J',
  channel: 'C04LQVA1Z2P',
  event_ts: '1708725482.598159',
  channel_type: 'channel'
} payload
 {
  client_msg_id: '1043f866-380c-4dd0-acf2-dd9091e81d58',
  type: 'message',
  text: 'this is a test message I am sending to a public channel',
  user: 'U04L3ME6VMY',
  ts: '1708725482.598159',
  blocks: [ { type: 'rich_text', block_id: 'CTnf8', elements: [Array] } ],
  team: 'T03NC3TG00J',
  channel: 'C04LQVA1Z2P',
  event_ts: '1708725482.598159',
  channel_type: 'channel'
}

Looks like the main payload argument is just getting put in all those fields but no envelope meta data is available.

Not sure if that event_ts value can be used in place of event_context. I was assuming that is a different field.

from bolt-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.