@@ -71,7 +71,7 @@ Pass a file name if the expression is complex:
7171
7272{{< details "router.txt" >}}
7373Write your expression like ` switch ` :
74- ```
74+ ``` javascript
7575Message .Message contains " foo" ? " CHAT1" :
7676From .ID == 123456 ? " CHAT2" :
7777Message .Views > 30 ? { Peer: " CHAT3" , Thread: 101 } :
@@ -111,6 +111,61 @@ Some message content can't be copied, such as poll, invoice, etc. They will be i
111111tdl forward --from tdl-export.json --mode clone
112112{{< /command >}}
113113
114+ ## Edit
115+
116+ Edit the message before forwarding based on [ expression] ( /reference/expr ) .
117+
118+ {{< hint info >}}
119+ - You must pass the first message of grouped photos to edit the caption.
120+ - You can pass any message of grouped documents to edit the corresponding comment.
121+ {{< /hint >}}
122+
123+ You can reference relevant fields from the original message in the expression.
124+
125+ List all available fields:
126+ {{< command >}}
127+ tdl forward --from tdl-export.json --edit -
128+ {{< /command >}}
129+
130+ Append ` Test Forwarded Message ` to the original message:
131+ {{< command >}}
132+ tdl forward --from tdl-export.json --edit 'Message.Message + " Test Forwarded Message"'
133+ {{< /command >}}
134+
135+ Write styled message with [ HTML] ( https://core.telegram.org/bots/api#html-style ) :
136+ {{< command >}}
137+ tdl forward --from tdl-export.json --edit \
138+ 'Message.Message + ` <b>Bold</b> <a href="https://example.com">Link</a> ` '
139+ {{< /command >}}
140+
141+ Pass a file name if the expression is complex:
142+
143+ {{< details "edit.txt" >}}
144+ ``` javascript
145+ repeat (Message .Message , 2 ) + `
146+ <a href="https://www.google.com">Google</a>
147+ <a href="https://www.bing.com">Bing</a>
148+ <b>bold</b>
149+ <i>italic</i>
150+ <code>code</code>
151+ <tg-spoiler>spoiler</tg-spoiler>
152+ <pre><code class="language-go">
153+ package main
154+
155+ import "fmt"
156+
157+ func main() {
158+ fmt.Println("hello world")
159+ }
160+ </code></pre>
161+ ` + From .VisibleName
162+ ```
163+ {{< /details >}}
164+
165+ {{< command >}}
166+ tdl forward --from tdl-export.json --edit edit.txt
167+ {{< /command >}}
168+
114169## Dry Run
115170
116171Print the progress without actually sending messages, which is useful for message routing debugging.
@@ -126,3 +181,21 @@ Send messages without notification.
126181{{< command >}}
127182tdl forward --from tdl-export.json --silent
128183{{< /command >}}
184+
185+ ## No Grouped Detection
186+
187+ By default, tdl will detect grouped messages and forward them as an album.
188+
189+ You can disable this behavior by ` --single ` to forward it as a single message.
190+
191+ {{< command >}}
192+ tdl forward --from tdl-export.json --single
193+ {{< /command >}}
194+
195+ ## Descending Order
196+
197+ Forward messages in descending order for each source.
198+
199+ {{< command >}}
200+ tdl forward --from tdl-export.json --desc
201+ {{< /command >}}
0 commit comments