slackapi / slackapi/python-slack-sdk
Need a method to get the channel ID using the current channel name
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 4k
- 派生
- 857
- 平均合并
- 22 小时 21 分钟
- 30 天内合并 PR
- 16
描述
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)
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 slack_sdk.web.WebClient 的同步和异步入口开始,检查现有的频道相关方法。将所请求的按频道名称查找与已弃用的 channels.info 以及 chat.postMessage 这一变通方案进行比较;完成的标准是提供一种可靠的方式来获取并存储频道 ID,而无需发布临时消息。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- api
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 38/100