I worked on a bash script that downloads all of Slack messages to my local computer. I have a few workspaces (some community workspaces) where I don't have admin permissions and a few free tier workspaces where messages are limited to 10K. I use this script to download chat messages to my computer everyday so I can grep them later at any time.
It's on github: https://github.com/t-tran/slack-chat-backup