Skip to content

larixk/slack-file-deleter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slack-file-deleter

Delete files through the Slack API through node.js

Installing

(Requires node.js and npm)

  1. Download or checkout this repo.
  2. Run npm install from the folder containing the repo

Usage

Before using, you need to create an access token for your Slack at https://api.slack.com/web

Usage: ./index.js [options]

Options:

  -h, --help           output usage information
  -V, --version        output the version number
  -t, --token <token>  Your Slack API token (required)
  -x, --types <items>  A list of filetypes (e.g. "png,jpg,mp3") to delete
  -s, --size <size>    All files above the specified size will be deleted
  -d, --dry            Perform a dry run only
  -l, --list           List all files on Slack ordered by filesize

Examples

Perform a dry run deleting all files with filetypes jpg, png or gif:

./index.js -t abcd-0123456789-0123456789-0123456789-0123456abc -x jpg,png,gif -d

Delete all files larger than 100 megabytes:

./index.js -t abcd-0123456789-0123456789-0123456789-0123456abc -s 100M

List all files visible to the user associated with the token:

./index.js -t abcd-0123456789-0123456789-0123456789-0123456abc -l

About

Delete files through the Slack API through node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •