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

ReactionAddedEvent uses non-exported sub interfaces. #765

Closed
4 of 10 tasks
feliperyan opened this issue Jan 21, 2021 · 0 comments · Fixed by #776
Closed
4 of 10 tasks

ReactionAddedEvent uses non-exported sub interfaces. #765

feliperyan opened this issue Jan 21, 2021 · 0 comments · Fixed by #776
Labels
bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented good first issue Good for newcomers TypeScript-specific

Comments

@feliperyan
Copy link

Description

Describe your issue here.

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • example code related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

package version: 3.0.0

node version: 12.3

OS version(s): MacOS 10.15.7

Steps to reproduce:

  1. Define an app.event('reaction_added', async ({ event, client }) => { ... listener.
  2. Try to access event.item.channel or event.item.ts

Expected result:

To be able to define which type item is = ReactionMessageItem, ReactionFileItem or ReactionFileCommentItem but these interfaces are not exported.

Actual result:

Property 'channel' does not exist on type 'ReactionMessageItem | ReactionFileItem | ReactionFileCommentItem'.
Property 'channel' does not exist on type 'ReactionFileItem'.

Full example code:

app.event('reaction_added', async ({ event, client }) => {
    console.log(`lab2 Reaction added: `, event.reaction);

    try {
        if(event.reaction === 'white_check_mark') {
              // Post message in thread of the message being reacted to
              await client.chat.postMessage({
                channel: event.item.channel,
                thread_ts: event.item.ts,
                text: `<@${event.user}> Thank you for successfully completing *lab 2* :two_hearts:`
              });
          }
    }
    catch(error) {
        console.log(error);
    }
});
@gitwave gitwave bot added the untriaged label Jan 21, 2021
@seratch seratch added bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented good first issue Good for newcomers TypeScript-specific and removed untriaged labels Jan 21, 2021
@seratch seratch mentioned this issue Feb 1, 2021
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented good first issue Good for newcomers TypeScript-specific
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants