Skip to content
forked from rusq/slackdump

Save or export your private and public Slack messages, threads, files, and users locally without admin privileges.

License

Notifications You must be signed in to change notification settings

dreambold/slackdump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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). Of course, everyone has their own favourite logger that is better than other miserable loggers. Please read below for instructions on your favourite logger.

Logrus

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

lg := logrus.New()
sd, err := New(context.Background(), provider, WithLogger(lg))
  if err != nil {
      log.Print(err)
      return
  }
}

Glog and others

If you need to use some other logger, such as glog, it is a matter of wrapping the calls to satisfy the logger.Interface (defined in the logger package), and then setting the Logger variable in slackdump.Options (see options.go), or using WithLogger option.

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.

About

Save or export your private and public Slack messages, threads, files, and users locally without admin privileges.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 96.2%
  • HTML 1.0%
  • Roff 1.0%
  • Shell 0.9%
  • Python 0.5%
  • Makefile 0.2%
  • Dockerfile 0.2%