To free up some space in your slack workspace and having to delete each file by hand
To run the app you first need a legacy token from slack for your workspace.
Then download the cleanSlack.js
file and run it via Node.js.
By default the script will delete files older than a year. You can change that in the TIMESTAMP
variable.
cd path/to/cleanSlack.js
token=xxxxxxxxxxxxxxxxxxxxxxxxxx node cleanSlack.js
This will run the script and delete each file one by one until done.
Map returns an array so maybe something to consider
original:
const files = []; response.files.map( file => files.push( file.id ) );
suggestion:
const files = response.files.map( f => f.id );