Skip to content

A tool which uses the Slack API and retrieves messages from a given Slack DM channel and saves the contents to a file

License

Notifications You must be signed in to change notification settings

barrymun/slack-history-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slack history exporter

Overview

Retrieve messages from DM (direct message) channels in Slack and append the output to a file. The functionality is basic and only the text content of the messages is appended to a new file with a given delimiter.

Get Started

Note

You'll need to create an app in Slack. Navigate to "OAuth & Permissions" and add the following user token scopes:

im:history

Tip

Make sure that user token scopes are used instead of bot token scopes, otherwise the DM history will not be retrieved.

Note

You will need to create a .env file at the root level of the project with the following keys:

SLACK_API_TOKEN=''
SLACK_CHANNEL_ID=''

Usage

Install dependencies:

yarn install

Run the script:

yarn run exe

The file history.txt will be created. If it already exists the contents will be overwritten.

Why does this exist?

Useful for people who may want to save messages from a Slack workspace that they are leaving, or a Slack workspace where the license is expiring.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A tool which uses the Slack API and retrieves messages from a given Slack DM channel and saves the contents to a file

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published