Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/barrymun/slack-history-exporter
A tool which uses the Slack API and retrieves messages from a given Slack DM channel and saves the contents to a file
https://github.com/barrymun/slack-history-exporter
slack slack-api
Last synced: 10 days ago
JSON representation
A tool which uses the Slack API and retrieves messages from a given Slack DM channel and saves the contents to a file
- Host: GitHub
- URL: https://github.com/barrymun/slack-history-exporter
- Owner: barrymun
- License: mit
- Created: 2024-04-27T13:55:31.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-15T08:47:03.000Z (8 months ago)
- Last Synced: 2024-11-07T00:27:09.986Z (about 2 months ago)
- Topics: slack, slack-api
- Language: TypeScript
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://api.slack.com/apps).
> Navigate to "OAuth & Permissions" and add the following **user token scopes**:
> ```[[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:
> ```[[env]]
> SLACK_API_TOKEN=''
> SLACK_CHANNEL_ID=''
> ```## Usage
Install dependencies:
```bash
yarn install
```Run the script:
```bash
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](LICENSE) file for details.