diff --git a/cmd/slackdump/internal/dump/assets/dump.md b/cmd/slackdump/internal/dump/assets/dump.md new file mode 100644 index 00000000..3c2f3423 --- /dev/null +++ b/cmd/slackdump/internal/dump/assets/dump.md @@ -0,0 +1,75 @@ +# Command Dump + +## Description + +Dump is the mode that allows to dump the following type of conversations: + +- public and private channels with threads +- group messages (MPIM) +- private messages (DMs) +- individual threads + +It downloads file attachments as well, if the `-download` flag is set. + +This is the original low-level mode that applies almost no transformations to +the API output mode of the Slackdump, and its behaviour would be familiar +to those who used it since the very first release. + +### IDs or URLs Parameter + +The `` parameter should list the IDs of conversations or URLs of +the channel or thread that you'd like to download, for example `C051D4052` is +a channel ID, and `https://ora600.slack.com/archives/DHYNUJ00Y` is a URL of a +private conversation (DM). You can also use an input file with the list of +IDs or URLs or combine file with conversations and individual conversation +links. + +## Examples + +### Dump one channel and a DM + +This command will also enable file download. + +```shell +slackdump dump -files C051D4052 DHYNUJ00Y +``` + +### Dump channels listed in my_channels.txt + +```shell +slackdump dump @my_channels.txt +``` + +### Dump a single thread + +Threads can be specified as a **URL**, or use a Slackdump-specific +**colon notation**. + +URL: + +```shell +slackdump dump \ + https://ora600.slack.com/archives/C051D4052/p1665917454731419 +``` + +Slackdump colon notation: + +```shell +slackdump dump C051D4052:1665917454.731419 +``` + +### Combined all of the above + +This example shows how you can combine different types of input. URL of the +thread is omitted for brevity: + +```shell +slackdump dump -files C051D4052 \ + DHYNUJ00Y \ + @my_channels.txt \ + C051D4052:1665917454.731419 +``` + +_Windows users_: please note that "\" is used on UNIX systems to split the +single command across multiple lines. The same command can be entered on a +single line without "\" and will have the same effect as the one above. diff --git a/cmd/slackdump/internal/dump/dump.go b/cmd/slackdump/internal/dump/dump.go index 8ac33707..f6699af0 100644 --- a/cmd/slackdump/internal/dump/dump.go +++ b/cmd/slackdump/internal/dump/dump.go @@ -1,25 +1,16 @@ package dump -import "github.com/rusq/slackdump/v2/cmd/slackdump/internal/golang/base" +import ( + _ "embed" -var CmdDump = &base.Command{ - UsageLine: "slackdump dump [flags] ", - Short: "dump individual conversations or threads", - Long: base.Render(` -# Command Dump - -Dump is the mode that allows to dump the following type of conversations: -- public and private channels with threads -- group messages (MPIM) -- private messages (DMs) -- individual threads + "github.com/rusq/slackdump/v2/cmd/slackdump/internal/golang/base" +) -It downloads file attachments as well. +//go:embed assets/dump.md +var dumpLong string -This is the original mode of the Slackdump, so its behaviour would be familiar -to those who used it since the first release. - -It can be considered as a low level mode, as there are no transformations, and -it is directly calling Slackdump library functions. -`), +var CmdDump = &base.Command{ + UsageLine: "slackdump dump [flags] ", + Short: "dump individual conversations or threads", + Long: base.Render(dumpLong), } diff --git a/cmd/slackdump/main.go b/cmd/slackdump/main.go index 2396d5dc..0ce13f72 100644 --- a/cmd/slackdump/main.go +++ b/cmd/slackdump/main.go @@ -17,6 +17,7 @@ import ( "github.com/rusq/slackdump/v2/cmd/slackdump/internal/apiconfig" "github.com/rusq/slackdump/v2/cmd/slackdump/internal/cfg" "github.com/rusq/slackdump/v2/cmd/slackdump/internal/diag" + "github.com/rusq/slackdump/v2/cmd/slackdump/internal/dump" "github.com/rusq/slackdump/v2/cmd/slackdump/internal/emoji" "github.com/rusq/slackdump/v2/cmd/slackdump/internal/export" "github.com/rusq/slackdump/v2/cmd/slackdump/internal/golang/base" @@ -36,6 +37,7 @@ func init() { base.Slackdump.Commands = []*base.Command{ wizard.CmdWizard, export.CmdExport, + dump.CmdDump, list.CmdList, emoji.CmdEmoji, workspace.CmdWorkspace,