Slack API 到 post 消息给特定用户

Slack API to post message to a specific user

我有一个机器人并通过 chat.postMessage endpoint, I'm able to send message to a channel. I'm also about to retrieve the list of users in slack using users.list。我正在尝试 'get' 用户列表,然后向特定用户(不是机器人)发送一条松弛消息。 chat.postMessage 仅接受频道 (id) 作为输入(以 C 开头)但不接受用户 ID(以 U 开头)。

如何实现?

从这个 post 得到答案。基本上,我需要从 conversations.open 方法获取频道 ID,然后使用聊天 postmessage.