How to delete all old files in Slack with one command

The free plan of Slack has some limitations. One is the disk space. You have 5Gb of storage. When you reach the limit, you have to delete each file individually. I will use a script to delete all the files older than 2 months.