Visitar URL original
Need a method to get the channel ID using the current channel name · Issue #1503 · slackapi/python-slack-sdk · GitHub
Skip to content

Need a method to get the channel ID using the current channel name #1503

Description

@angrychimp

We need a way to get the channel ID when provided the current channel name as an input. Previously this could be done using the channels.info API method, but now with that method fully deprecated and disabled, we don't have any other reliable method of doing this. We could theoretically post a new message to the channel using chat.postMessage, which returns the channel ID, then remove that message, but this seems like overkill.

The use case is that a user provides a channel name as input, and we want to convert that channel name to an ID and store that ID for later use when posting messages. Obviously the name may change over time, so using the channel ID is ideal.

Category

  • slack_sdk.web.WebClient (sync/async) (Web API client)
  • slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
  • slack_sdk.models (UI component builders)
  • slack_sdk.oauth (OAuth Flow Utilities)
  • slack_sdk.socket_mode (Socket Mode client)
  • slack_sdk.audit_logs (Audit Logs API client)
  • slack_sdk.scim (SCIM API client)
  • slack_sdk.rtm (RTM client)
  • slack_sdk.signature (Request Signature Verifier)

Activity

  1. angrychimp commented on Jun 4, 2024

    @angrychimp
    Author

    If there's already a pattern for this and I'm just completely missing it in the documentation, please let me know. Thanks!

  2. WilliamBergamin commented on Jun 4, 2024

    @WilliamBergamin
    Contributor

    HI @angrychimp thanks for writing in 💯

    This is a less then ideal scenario, I do not know a simple workaround for this, but since this is a backend issue I would suggest asking for a fix via feedback@slack.com

  3. added
    questionM-T: User needs support to use the project
    and removed on Jun 4, 2024
  4. amshamah419 commented on Jul 4, 2024

    @amshamah419

    To add to this, we also are struggling with this issue and we typically run into the rate limit prior to getting the result we need. For us, this would reduce the api calls from hundreds down to one.

  5. github-actions commented on Aug 5, 2024

    @github-actions

    👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.

  6. angrychimp commented on Aug 5, 2024

    @angrychimp
    Author

    I absolutely wish to have this looked at. This is an ongoing concern and I routinely run into situations where an easy method to convert channel name to and ID would be far easier than scanning a full list of channels in a workspace

  7. github-actions commented on Sep 16, 2024

    @github-actions

    👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.

  8. angrychimp commented on Sep 17, 2024

    @angrychimp
    Author

    Commenting again to prevent this from being closed. Still hoping this gets looked at.

  9. zimeg commented on Sep 28, 2024

    @zimeg
    Member

    Hi @angrychimp 👋 This is a popular feature request that I agree would be useful, but we can only recommend paginating the conversations.list method and filtering outputs from the SDK side of things. I understand all of the concerns with rate limits and that this isn't an ideal approach, but I can only echo messaging feedback@slack.com 😓

    I do think it's worth keeping this issue open too so others can +1 👍 in agreement, but we don't have other plans to share at the moment.

    📚 For more reference, this has been mentioned in issues like: #405, #1066, #1158, #1495, and a few other times in other repos.

  10. etiennnr commented on Oct 10, 2024

    @etiennnr

    +1 to this.

    For our usecase, we post messages and files to multiple channels (public and private). The conversation.list method returns only public channels (ref: #1312 and #1494). We've ended up just statically mapping the channels name to the id in config, which is far from ideal... And a method to provide the channel name as input and returns channels ID sounds pretty barebone / simple.

    @zimeg You're saying this has been requested multiple times (since 2019...) and still no improvments or even just a timeline? This is even worst considering that this feature existed in channels.info which has been deprecated (not sure I understand the reason why BTW).

  11. filmaj commented on Oct 10, 2024

    @filmaj
    Contributor

    You're saying this has been requested multiple times (since 2019...) and still no improvments or even just a timeline?

    This is correct. I kindly ask for your understanding that myself, zim and other Slack employees that engage in these public GitHub issues with y'all do everything we can to raise your feedback, but ultimately these decisions and prioritizations are not ours to make. The only recourse I can suggest is to have your voice be heard by emailing feedback@slack.com. If I could make the decision, I would provide such an API for you and the countless other developers who have asked for this feature. Unfortunately, I cannot make that decision.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    auto-triage-skipduplicateAn issue for the same purpose already exists, and a link is in the commentsquestionM-T: User needs support to use the projectserver-side-issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions