@@ -19,10 +19,70 @@ Upload to custom chat.
1919
2020{{< include "snippets/chat.md" >}}
2121
22+ ### Specific Chat
23+
24+ Upload to specific one chat:
25+
2226{{< command >}}
2327tdl up -p /path/to/file -c CHAT
2428{{< /command >}}
2529
30+ Upload to specific topic in a forum chat:
31+
32+ {{< command >}}
33+ tdl up -p /path/to/file -c CHAT --topic TOPIC_ID
34+ {{< /command >}}
35+
36+ ### Message Routing
37+
38+ Upload to different chats by message router which is based on [ expression] ( /reference/expr ) .
39+
40+ {{< hint warning >}}
41+ The ` --to ` flag is conflicted with the ` -c/--chat ` and ` --topic ` flags. You can only use one of them.
42+ {{< /hint >}}
43+
44+ List all available fields:
45+
46+ {{< command >}}
47+ tdl up -p /path/to/file --to -
48+ {{< /command >}}
49+
50+ Upload to ` CHAT1 ` if MIME contains ` video ` , otherwise upload to ` Saved Messages ` :
51+
52+ {{< hint info >}}
53+ You must return a ** string** or ** struct** as the target CHAT, and empty string means upload to ` Saved Messages ` .
54+ {{< /hint >}}
55+
56+ {{< command >}}
57+ tdl up -p /path/to/file \
58+ --to 'MIME contains "video" ? "CHAT1" : ""'
59+ {{< /command >}}
60+
61+ Upload to ` CHAT1 ` if MIME contains ` video ` , otherwise upload to reply to message/topic ` 4 ` in ` CHAT2 ` :
62+
63+ {{< command >}}
64+ tdl up -p /path/to/file \
65+ --to 'MIME contains "video" ? "CHAT1" : { Peer: "CHAT2", Thread: 4 }'
66+ {{< /command >}}
67+
68+ Pass a file name if the expression is complex:
69+
70+ {{< details "router.txt" >}}
71+ Write your expression like ` switch ` :
72+
73+ ``` javascript
74+ MIME contains " video" ? " CHAT1" :
75+ FileExt contains " .mp3" ? " CHAT2" :
76+ FileName contains " chat3" > 30 ? {Peer: " CHAT3" , Thread: 101 } :
77+ " "
78+ ```
79+
80+ {{< /details >}}
81+
82+ {{< command >}}
83+ tdl up -p /path/to/file --to router.txt
84+ {{< /command >}}
85+
2686## Custom Parameters
2787
2888Upload with 8 threads per task, 4 concurrent tasks:
@@ -38,17 +98,17 @@ Custom caption is based on [expression](/reference/expr).
3898List all available fields:
3999
40100{{< command >}}
41- tdl up -p ./downloads --caption -
101+ tdl up -p /path/to/file --caption -
42102{{< /command >}}
43103
44104Custom simple caption:
45105{{< command >}}
46- tdl up -p ./downloads --caption 'File.Name + " - uploaded by tdl"'
106+ tdl up -p /path/to/file --caption 'FileName + " - uploaded by tdl"'
47107{{< /command >}}
48108
49109Write styled message with [ HTML] ( https://core.telegram.org/bots/api#html-style ) :
50110{{< command >}}
51- tdl up -p ./downloads --caption \
111+ tdl up -p /path/to/file --caption \
52112'FileName + ` <b>Bold</b> <a href="https://example.com">Link</a> ` '
53113{{< /command >}}
54114
@@ -79,15 +139,7 @@ func main() {
79139{{< /details >}}
80140
81141{{< command >}}
82- tdl up -p ./downloads --caption caption.txt
83- {{< /command >}}
84-
85- ## Filter
86-
87- Upload files except specified extensions:
88-
89- {{< command >}}
90- tdl up -p /path/to/file -p /path/to/dir -e .so -e .tmp
142+ tdl up -p /path/to/file --caption caption.txt
91143{{< /command >}}
92144
93145## Filters
0 commit comments