mirror of
https://github.com/iyear/tdl
synced 2025-01-08 11:57:55 +08:00
feat(download): add FileCaption
to download template (#560)
* feat(download): add FileCaption to download template * doc(template.md): add FileCaption description
This commit is contained in:
parent
51677e6147
commit
91b1e17d1c
@ -31,6 +31,7 @@ type fileTemplate struct {
|
||||
MessageID int
|
||||
MessageDate int64
|
||||
FileName string
|
||||
FileCaption string
|
||||
FileSize string
|
||||
DownloadDate int64
|
||||
}
|
||||
@ -177,6 +178,7 @@ func (i *iter) process(ctx context.Context) (ret bool, skip bool) {
|
||||
MessageID: message.ID,
|
||||
MessageDate: int64(message.Date),
|
||||
FileName: item.Name,
|
||||
FileCaption: message.Message,
|
||||
FileSize: utils.Byte.FormatBinaryBytes(item.Size),
|
||||
DownloadDate: time.Now().Unix(),
|
||||
})
|
||||
|
@ -14,14 +14,15 @@ Template syntax is based on [Go's text/template](https://golang.org/pkg/text/tem
|
||||
|
||||
### Variables (beta)
|
||||
|
||||
| Var | Desc |
|
||||
|:--------------:|:------------------------------------:|
|
||||
| `DialogID` | Telegram dialog id |
|
||||
| `MessageID` | Telegram message id |
|
||||
| `MessageDate` | Telegram message date(timestamp) |
|
||||
| `FileName` | Telegram file name |
|
||||
| `FileSize` | Human-readable file size, like `1GB` |
|
||||
| `DownloadDate` | Download date(timestamp) |
|
||||
| Var | Desc |
|
||||
|:--------------:|:----------------------------------------:|
|
||||
| `DialogID` | Telegram dialog id |
|
||||
| `MessageID` | Telegram message id |
|
||||
| `MessageDate` | Telegram message date(timestamp) |
|
||||
| `FileName` | Telegram file name |
|
||||
| `FileCaption` | Telegram file caption, aka. text message |
|
||||
| `FileSize` | Human-readable file size, like `1GB` |
|
||||
| `DownloadDate` | Download date(timestamp) |
|
||||
|
||||
### Functions (beta)
|
||||
|
||||
|
@ -14,14 +14,15 @@ bookToC: false
|
||||
|
||||
### 变量 (Beta)
|
||||
|
||||
| 变量 | 描述 |
|
||||
|:--------------:|:------------------:|
|
||||
| `DialogID` | Telegram 对话ID |
|
||||
| `MessageID` | Telegram 消息ID |
|
||||
| `MessageDate` | Telegram 消息日期(时间戳) |
|
||||
| `FileName` | Telegram 文件名 |
|
||||
| `FileSize` | 可读的文件大小,例如 `1GB` |
|
||||
| `DownloadDate` | 下载日期(时间戳) |
|
||||
| 变量 | 描述 |
|
||||
|:--------------:|:---------------------:|
|
||||
| `DialogID` | Telegram 对话ID |
|
||||
| `MessageID` | Telegram 消息ID |
|
||||
| `MessageDate` | Telegram 消息日期(时间戳) |
|
||||
| `FileName` | Telegram 文件名 |
|
||||
| `FileCaption` | Telegram 文件说明,也就是文本消息 |
|
||||
| `FileSize` | 可读的文件大小,例如 `1GB` |
|
||||
| `DownloadDate` | 下载日期(时间戳) |
|
||||
|
||||
### 函数 (Beta)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user