Python-slack-sdk: Access old channel messages.

Created on 12 Jun 2018  路  4Comments  路  Source: slackapi/python-slack-sdk

Description

How do we access old channel messages with the slackclient before the bot was added to the channel. Is this possible in the first place?

What type of issue is this? (place an x in one of the [ ])

  • [ ] bug
  • [ ] enhancement (feature request)
  • [X ] question
  • [ ] documentation related
  • [ ] testing related
  • [ ] discussion

Requirements (place an x in each of the [ ])

  • [X ] I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • [X ] I've read and agree to the Code of Conduct.
  • [X ] I've searched for any related issues and avoided creating a duplicate issue.

Most helpful comment

No, you can go back to the beginning of the channel history. You just can鈥檛 get more than 1000 messages at a time. Use the latest and oldest options to traverse the history by a chunk at a time.

All 4 comments

You sure can. You鈥檒l have to use the Web API to call the channels.history method.

sc.api_call("channels.history", options)

Hi @aoberoi Thank you for that. Is it restricted to 1000 messages though?

No, you can go back to the beginning of the channel history. You just can鈥檛 get more than 1000 messages at a time. Use the latest and oldest options to traverse the history by a chunk at a time.

Perfect, thank you :)

Was this page helpful?
0 / 5 - 0 ratings