Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jordan-loeser/slack-file-cleaner
Frees up space by mass-deleting old, unpinned files in Slack channels and DM's using Slack API.
https://github.com/jordan-loeser/slack-file-cleaner
python slack slack-api space-management
Last synced: 13 days ago
JSON representation
Frees up space by mass-deleting old, unpinned files in Slack channels and DM's using Slack API.
- Host: GitHub
- URL: https://github.com/jordan-loeser/slack-file-cleaner
- Owner: jordan-loeser
- Created: 2018-01-11T18:04:20.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-11T22:19:01.000Z (about 7 years ago)
- Last Synced: 2024-11-14T18:49:35.243Z (2 months ago)
- Topics: python, slack, slack-api, space-management
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Slack-File-Cleaner 🛁
Frees up space by mass-deleting old, unpinned files in Slack channels and DM's.
## Usage
Download the `slack_delete.py` file and `cd` into it's directory.```
python3 slack_delete.py --token
```
Replace `` with the [API token found here](https://api.slack.com/custom-integrations/legacy-tokens).
```
[*] Fetching file list..
Filename2.jpg is pinned to #general.
Filename1.pdf is pinned to a private direct message.
3 unpinned files.
[*] Delete the unpinned files? (y/n): y
```
Confirm if you want to delete the unpinned files by typing `y` or `n`.
```
[*] Deleting files older than 30 days ...
1 of 3 - F8R1W9P7S True
2 of 3 - F9R1X8P7S True
3 of 3 - F7R1W9P7Z True[*] Done
```
The sript will show you each `file_id` and whether or not the file could be deleted.## Optional Flags
Set the script to delete files older than `` days.
The default is to delete unpinned files over 30 days old.
```
--days
```
Set the script to delete a maximum of `` at one time.
The default is to delete a maximum of 1000 files.
```
--count
```
#### Credits: Forked from [this gist by jamescmartinez](https://gist.github.com/jamescmartinez/909401b19c0f779fc9c1).