Skip to content

UoEMainLibrary/SlackExport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

SlackExport

Two scripts:

export_im.py exports all Slack instant messages into a directory called slack_dm_export. Files named dm_with_username.json for 121 chats and mpim_with_mpdm_username_username_username.json for multi-person.

export_channels.py exports all Slack channels into a directory called slack_channel_export. Files named channel_channelname.json.

In order for this to work, you need two things

  1. requests Python library
  2. a user token in Slack

To get the latter, follow these steps

  1. Create (or open) a Slack app
  • Go to Slack API Apps: https://api.slack.com/apps
  • open_in_new
  • Click Create New App
  • Choose From scratch
  • Pick your app name and the workspace you want to install it to (Digital Library)
  1. Configure OAuth & Permissions (user scopes)
  • In the left sidebar, go to OAuth & Permissions
  • Scroll to Scopes
  • Under User Token Scopes, click Add an OAuth Scope
  • Add the user-level scopes you need (examples): -- users:read (read user info) -- im:read, im:history -- mpim:read, mpim:history -- channels:read, channels:history -- groups:read, groups:history
  • If you instead add scopes under Bot Token Scopes, you’ll get a bot token (xoxb-...), not a user token (xoxp-...) and it won't work!
  1. Install the app to your workspace
  • Still in OAuth & Permissions, click Install to (Workspace)
  • Review the permissions screen
  • Click Allow
  1. Copy the User OAuth Token After installation:
  • Go back to OAuth & Permissions
  • Look for OAuth Tokens for Your Workspace
  • Copy the User OAuth Token (starts with xoxp-...)
  1. Copy the token into your scripts above ======= CONFIGURE YOUR TOKEN HERE ======= TOKEN = "" # DO NOT share publicly

About

Scripts to export conversations and channels from Slack

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages