- Slack is a leader in the industry, in part because it was one of the first to capture mass attention but also because it’s a highly efficient way to collaborate. The clean interface is.
- Slack Cleaner & Backup Tool you have always wanted! You can backup and delete all the Slack messages at once with this easy app. Just choose what to.
- Spring cleaning: tips for tidying up your channels. How and when to archive, mute, leave and star channels in Slack—keeping your workspace easy to navigate. Author: Matt HaugheyMarch 14th, 2019Illustration by Pete Ryan.
Bulk delete messages and files on Slack.
this is a fork of https://github.com/kfei/slack-cleaner
Welcome to the PySlackers community! We are a growing and inclusive community of Python enthusiasts ranging from those just starting to those who have built their entire career around it. Our community has a range of resources from our main presence on Slack to our community projects.
Install
Install from Pip:
current development version:
If you prefer Docker, there is a pre-built Docker image as well:
Just use docker run -it --rm sgratzl/slack-cleaner -c 'slack-cleaner ...'
for each command or jump into a shell using docker run -it --rm sgratzl/slack-cleaner
.
Install for Fedora or EPEL7
Slack-cleaner Token
@rapgro maintains packages for both Fedora and EPEL7
Arguments
Permission Scopes needed
The permissions to grant depend on what you are going to use the script for.Grant the permissions below depending on your use.
Beyond granting permissions, if you wish to use this script to deletemessages or files posted by others, you will need to be an Owner orAdminof the workspace.
Deleting messages from public channels
channels:history
channels:read
chat:write
(or bothchat:write:user
andchat:write:bot
for older apps)users:read
Deleting messages from private channels
groups:history
groups:read
chat:write
(orchat:write:user
for older apps)users:read
Deleting messages from 1:1 IMs
im:history
im:read
chat:write
(orchat:write:user
for older apps)users:read
Deleting messages from multi-person IMs
mpim:history
mpim:read
chat:write
(orchat:write:user
for older apps)users:read
Deleting files
files:read
files:write
(orfiles:write:user
for older apps)users:read
Usage
Configuring app
The cleaner needs you to give Slack's API permission to let it run theoperations it needs. You grant these by registering it as an app in theworkspace you want to use it in.
You can grant these permissions to the app by:
- going to Your Apps
- select 'Create New App', fill out an App Name (eg 'Slack Cleaner') andselect the Slack workspace you want to use it in
- select 'OAuth & Permissions' in the sidebar
- scroll down to Scopes and select all scopes you need
- select 'Save changes'
- select 'Install App to Workspace'
- review the permissions and press 'Authorize'
- copy the 'OAuth Access Token' shown, and use this token as the
--token
argument to the script
Tips
After the task, a backup file slack-cleaner.<timestamp>.log
will be created in current directory if --log
is supplied.
Slack Delete All Drafts
If any API problem occurred, try --rate=<delay-in-seconds>
to reduce the API call rate (which by default is unlimited).
If you see the following warning from urllib3
, consider to install missingpackages: pip install --upgrade requests[security]
or just upgrade your Python to 2.7.9.
Credits
To all the people who can only afford a free plan.