Just an extra note, the script should be adjusted to take into account thread replies:
"This Conversations API method returns an entire thread (a message plus all the messages in reply to it), while conversations.history method returns only parent messages."
but when I try to pull them via script I get auth_error. I tried adding scopes, but that doesn't seem to work... 😕
https://api.slack.com/apps/A01P22F63ND/oauth?