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

How do i get a list of channles in Typescript ?? #633

Closed
2 of 9 tasks
ryosebach opened this issue Sep 13, 2018 · 3 comments
Closed
2 of 9 tasks

How do i get a list of channles in Typescript ?? #633

ryosebach opened this issue Sep 13, 2018 · 3 comments
Labels
needs info An issue that is claimed to be a bug and hasn't been reproduced, or otherwise needs more info question M-T: User needs support to use the project

Comments

@ryosebach
Copy link

ryosebach commented Sep 13, 2018

Description

In typescript, how do i get a list of channels??

In web.channels.list().then((res) => {}), res 's type is WebAPICallResult....
https://slackapi.github.io/node-slack-sdk/web_api#getting-a-list-of-channels

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

  • bug
  • enhancement (feature request)
  • question
  • documentation 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.
@aoberoi
Copy link
Contributor

aoberoi commented Sep 13, 2018

this is a good question @ryosebach. for now, you have two options:

  1. cast individual properties you know should exist on the result to the type you know they will have by looking at the api reference (https://api.slack.com/methods/channels.list)
  2. define a type for the entire result object which extends WebAPICallResult, including the properties you want to use, and cast res to this type.

both of these are less than ideal, and we're trying to figure out the best solution for the future in #496. we'd love to hear your thoughts or feedback about this there.

@aoberoi aoberoi added question M-T: User needs support to use the project needs info An issue that is claimed to be a bug and hasn't been reproduced, or otherwise needs more info labels Sep 13, 2018
@aoberoi
Copy link
Contributor

aoberoi commented Sep 15, 2018

If this answers your question, can you close this issue?

@ryosebach
Copy link
Author

@aoberoi
I see, thank you a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs info An issue that is claimed to be a bug and hasn't been reproduced, or otherwise needs more info question M-T: User needs support to use the project
Projects
None yet
Development

No branches or pull requests

2 participants