Skip to content

Commit

Permalink
docs(cmd): chat export. close #37
Browse files Browse the repository at this point in the history
  • Loading branch information
iyear committed Oct 10, 2022
1 parent 2e3cbca commit 1a5ec34
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/chat/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var (

var cmdExport = &cobra.Command{
Use: "export",
Short: "export messages from (protected) chat",
Short: "export messages from (protected) chat for downloading",
RunE: func(cmd *cobra.Command, args []string) error {
if to == 0 {
to = int(time.Now().Unix())
Expand All @@ -25,7 +25,7 @@ var cmdExport = &cobra.Command{
}

func init() {
cmdExport.Flags().StringVarP(&_chat, "chat", "c", "", "")
cmdExport.Flags().StringVarP(&_chat, "chat", "c", "", "chat id or domain")
cmdExport.Flags().IntVar(&from, "from", 0, "timestamp of the starting message")
cmdExport.Flags().IntVar(&to, "to", 0, "timestamp of the ending message, default value is NOW")
cmdExport.Flags().StringVarP(&output, "output", "o", "tdl-export.json", "output JSON file path")
Expand Down
1 change: 1 addition & 0 deletions docs/command/tdl_chat.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ A set of chat tools
### SEE ALSO

* [tdl](tdl.md) - Telegram Downloader, but more than a downloader
* [tdl chat export](tdl_chat_export.md) - export messages from (protected) chat for downloading
* [tdl chat ls](tdl_chat_ls.md) - List your chats

34 changes: 34 additions & 0 deletions docs/command/tdl_chat_export.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## tdl chat export

export messages from (protected) chat for downloading

```
tdl chat export [flags]
```

### Options

```
-c, --chat string chat id or domain
--from int timestamp of the starting message
-h, --help help for export
-o, --output string output JSON file path (default "tdl-export.json")
--to int timestamp of the ending message, default value is NOW
```

### Options inherited from parent commands

```
--debug enable debug mode
-l, --limit int max number of concurrent tasks (default 2)
-n, --ns string namespace for Telegram session
--ntp string ntp server host, if not set, use system time
--proxy string proxy address, only socks5 is supported, format: protocol://username:password@host:port
-s, --size int part size for transfer, max is 512*1024 (default 131072)
-t, --threads int threads for transfer one item (default 4)
```

### SEE ALSO

* [tdl chat](tdl_chat.md) - A set of chat tools

0 comments on commit 1a5ec34

Please sign in to comment.