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

files property missing in app_mention event #2056

Closed
thefron opened this issue Feb 13, 2024 · 3 comments · Fixed by #2057 or Jrc356/avokudos#34 · May be fixed by mohammad-84/starter-slack-boltjs#1, mohammad-84/starter-slack-boltjs#2 or mohammad-84/starter-slack-boltjs#3
Labels
bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented TypeScript-specific
Milestone

Comments

@thefron
Copy link

thefron commented Feb 13, 2024

I'm working with message and app_mention events and noticed the files field is missing from the AppMentionEvent interface, despite being present in the actual app_mention event payload and in message events of type GenericMessageEvent. Since the payloads for app_mention and message events are nearly identical except for the event type, I'm considering extending the AppMentionEvent interface locally to include files.
Could you confirm if it's possible to officially add the files property to the AppMentionEvent interface for consistency?

Reproducible in:

The Slack SDK version

    "@slack/bolt": "^3.17.0",
    "@slack/web-api": "^6.11.2",

Node.js runtime version

v18.19.0

OS info

ProductName: macOS
ProductVersion: 14.0
BuildVersion: 23A344
Darwin Kernel Version 23.0.0: Fri Sep 15 14:43:05 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T6020

Steps to reproduce:

event.files is missing in app_mention event

app.event("app_mention", async ({ event, body, say, client, context }) => {
  if (event.bot_id === context.botId) return
  console.log(event.files)
})

I can access event.files in message event

app.event("message", async ({ event, body, context }) => {
  if (event.type !== "message" || event.subtype !== undefined) return
  console.log(event.files)
})

Expected result:

event.files property is available in app_mention event.

Actual result:

Property 'files' does not exist on the type 'AppMentionEvent'

Requirements

For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

@seratch seratch added bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented TypeScript-specific and removed untriaged labels Feb 13, 2024
@seratch seratch added this to the 3.18.0 milestone Feb 13, 2024
seratch added a commit to seratch/bolt-js that referenced this issue Feb 13, 2024
@seratch
Copy link
Member

seratch commented Feb 13, 2024

Hi @thefron, thanks for taking the time to report this issue! You're right that the property should be added in the type definition. We will add the property in the next release.

@thefron
Copy link
Author

thefron commented Feb 13, 2024

@seratch Thank you for the quick action and addressing the issue! Looking forward to the next release. Your support is greatly appreciated!

@filmaj
Copy link
Contributor

filmaj commented Apr 25, 2024

Sorry for the delay here but this fix is now live in bolt v3.18.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment