Salman, Aled and I have been busy setting up a new technology community, Cloud Native Wales. We’re looking to go live and invite people to use some of our tools, but realise that we’ve been using the #general a bit too much and want to remove some of the rubbish prior to going live.
Since then, we’ve found out that #general is a privileged channel, and it’s difficult to bulk delete all the messages. Luckily, we found a way to fix it!
- Install Node.js.
- Download a copy of delete-channel-messages.js.
- Generate a Slack token.
- Get the Slack Channel Id.
- Go to your Slack channel URL, for example:
- The url will be redirected with your Channel Id:
- The Channel Id in the example would be
- Update delete-channel-messages.js with your Token and Channel Id.
- Start the script:
sh node delete-channel-messages.js