Skip to content

Latest commit

 

History

History
144 lines (104 loc) · 4.12 KB

README.rst

File metadata and controls

144 lines (104 loc) · 4.12 KB

Slack Dumper

Purpose: dump Slack messages, users and files using browser token and cookie.

Typical use scenarios:

  • archive your private conversations from Slack when the administrator does not allow you to install applications OR you don't want to use potentially privacy-violating third-party tools,
  • archive channels from Slack when you're on a free "no archive" subscription, so you don't lose valuable knowledge in those channels.
  • create a Slack Export archive without admin access.

There a three modes of operation (more on this in User Guide) :

  1. List users/channels
  2. Dumping messages and threads
  3. Creating a Slack Export.

Slackdump accepts two types of input (see Dumping Conversations section):

  1. the URL/link of the channel or thread, OR
  2. the ID of the channel.

Please see the User Guide.

Download:

go get github.com/rusq/slackdump/v2

Add the following line at the end of your project's go.mod file:

replace github.com/slack-go/slack => github.com/rusq/slack v0.11.100

This is required, as Slackdump relies on custom authentication scheme that uses cookies, and those functions are simply not in the original library.

import (
  "github.com/rusq/slackdump/v2"
  "github.com/rusq/slackdump/v2/auth"
)

func main() {
  provider, err := auth.NewValueAuth("xoxc-...", "xoxd-...")
  if err != nil {
      log.Print(err)
      return
  }
  sd, err := New(context.Background(), provider)
  if err != nil {
      log.Print(err)
      return
  }
  _ = sd
}

See go ref

Slackdump uses a simple rusq/dlog as a default logger (it is a wrapper around the standard logger that adds Debug* functions). If you need to plug in some other logger, such as logrus or glog, it is a matter of wrapping the calls of the logger of your choice, to satisfy the logger.Interface (defined in the logger package), and then setting the Logger variable in slackdump.Options (see options.go).

Note

logrus can be plugged in straight away, as it implements the logger.Interface out of the box.

Q:Do I need to create a Slack application?
A:No, you don't. Just run the application and EZ-Login 3000 will take care of the authentication or, alternatively, grab that token and cookie from the browser Slack session. See User Guide.
Q:I'm getting "invalid_auth" error
A:Go get the new Cookie from the browser and Token as well.

Messages that were conveyed with the donations:

  • 25/01/2022: Stay away from TheSignChef.com, ya hear, they don't pay what they owe to their employees.