简体   繁体   中英

How to get Slack App's Message tab Channel ID

I am working on developing Slack App that sends messages from the button in the Home tab to the app's Messages tab in python. But do you know how to get a Message Tab's Channel ID for the App using Slack API?? Because the app's Message tab channel ID is different for each user, I cannot just use the channel ID it is shown in the app. So I want when each user clicks a button in the App's home tab, the message will be shown in the Message tab in the App for each user.

Thank you

When each user clicks the button in Slack, you should be given some context about the event. In that, you should see the user's Slack ID.

You are able to use the users Slack ID to post a message to the Messages tab.

await client.chat.postMessage({
  channel: 'U0123456789,
  blocks: [...],
  text: 'Will post a message in the app Messages tab!',
})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM