def get_conversation_history(self, channel_id, latest, oldest): In order to retrieve all the messages from a particular channel in slack this can be done by using conversations.history method in slack_sdk library in python. Threads function a bit like conversations within a conversation and need to be downloaded separately.Ĭheck out this page of the official documentation for more details on threading. In addition use conversations.replies to download threads in a conversation. bot IDs: (there is no official bots.list method, but there is an unofficial one, which might help in some cases).Note that this method will return messages in a raw JSON format with IDs only, so you will need to call additional API method to resolve those IDs into plain text: This method also supports paging allowing you to download large amounts of messages. The new API method conversations.history will allow you to download messages from every type of conversation / channel (public, private, DM, Group DM) as long as your token has access to it. With the new Conversations API this task is bit easier now.
0 Comments
Leave a Reply. |