✏️ Fixed format of Upload method documentation
This commit is contained in:
parent
c7d6ae824f
commit
a09b274952
24
upload.go
24
upload.go
|
@ -31,22 +31,28 @@ file. 5 MB max size for photos and 20 MB max for other types of content.
|
||||||
3. Post the file using multipart/form-data in the usual way that files are uploaded via the
|
3. Post the file using multipart/form-data in the usual way that files are uploaded via the
|
||||||
browser. Use []byte or io.Reader for this. 10 MB max size for photos, 50 MB for other files.
|
browser. Use []byte or io.Reader for this. 10 MB max size for photos, 50 MB for other files.
|
||||||
|
|
||||||
Sending by file_id
|
Sending by FileID
|
||||||
|
|
||||||
- It is not possible to change the file type when resending by file_id. I.e. a video can't be sent
|
* It is not possible to change the file type when resending by file_id. I.e. a video can't be sent
|
||||||
as a photo, a photo can't be sent as a document, etc.
|
as a photo, a photo can't be sent as a document, etc.
|
||||||
- It is not possible to resend thumbnails.
|
|
||||||
- Resending a photo by file_id will send all of its sizes.
|
* It is not possible to resend thumbnails.
|
||||||
- file_id is unique for each individual bot and can't be transferred from one bot to another.
|
|
||||||
|
* Resending a photo by file_id will send all of its sizes.
|
||||||
|
|
||||||
|
* file_id is unique for each individual bot and can't be transferred from one bot to another.
|
||||||
|
|
||||||
Sending by URL
|
Sending by URL
|
||||||
|
|
||||||
- When sending by *url.URL the target file must have the correct MIME type (e.g., audio/mpeg for
|
* When sending by *url.URL the target file must have the correct MIME type (e.g., audio/mpeg for
|
||||||
sendAudio, etc.).
|
sendAudio, etc.).
|
||||||
- In sendDocument, sending by URL will currently only work for gif, pdf and zip files.
|
|
||||||
- To use SendVoice, the file must have the type audio/ogg and be no more than 1MB in size. 1–20MB
|
* In sendDocument, sending by URL will currently only work for gif, pdf and zip files.
|
||||||
|
|
||||||
|
* To use SendVoice, the file must have the type audio/ogg and be no more than 1MB in size. 1–20MB
|
||||||
voice notes will be sent as files.
|
voice notes will be sent as files.
|
||||||
- Other configurations may work but we can't guarantee that they will.
|
|
||||||
|
* Other configurations may work but we can't guarantee that they will.
|
||||||
*/
|
*/
|
||||||
func (bot *Bot) Upload(method, key, name string, file InputFile, args fmt.Stringer) (*Response, error) {
|
func (bot *Bot) Upload(method, key, name string, file InputFile, args fmt.Stringer) (*Response, error) {
|
||||||
buffer := bytes.NewBuffer(nil)
|
buffer := bytes.NewBuffer(nil)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user