Skip to content

Commit d2539d0

Browse files
committed
Update more docs.
1 parent 9e20459 commit d2539d0

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/internals/adding-endpoints.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ type DeleteMessageConfig struct {
1919
}
2020
```
2121

22-
What type should `ChatID` be? Telegram allows specifying numeric chat IDs or channel usernames. Golang doesn't have union types, and interfaces are entirely
22+
What type should `ChatID` be? Telegram allows specifying numeric chat IDs or
23+
channel usernames. Golang doesn't have union types, and interfaces are entirely
2324
untyped. This library solves this by adding two fields, a `ChatID` and a
2425
`ChannelUsername`. We can now write the struct as follows.
2526

@@ -103,8 +104,8 @@ have similar fields for their files.
103104
ChannelUsername string
104105
ChatID int64
105106
MessageID int
106-
+ Delete interface{}
107-
+ Thumb interface{}
107+
+ Delete RequestFileData
108+
+ Thumb RequestFileData
108109
}
109110
```
110111

@@ -115,21 +116,22 @@ and add the `thumb` file if we have one.
115116
func (config DeleteMessageConfig) files() []RequestFile {
116117
files := []RequestFile{{
117118
Name: "delete",
118-
File: config.Delete,
119+
Data: config.Delete,
119120
}}
120121

121122
if config.Thumb != nil {
122123
files = append(files, RequestFile{
123124
Name: "thumb",
124-
File: config.Thumb,
125+
Data: config.Thumb,
125126
})
126127
}
127128

128129
return files
129130
}
130131
```
131132

132-
And now our files will upload! It will transparently handle uploads whether File is a string with a path to a file, `FileURL`, `FileBytes`, `FileReader`, or `FileID`.
133+
And now our files will upload! It will transparently handle uploads whether File
134+
is a `FilePath`, `FileURL`, `FileBytes`, `FileReader`, or `FileID`.
133135

134136
### Base Configs
135137

0 commit comments

Comments
 (0)