files: add file_name and disable content type detection fields

pull/405/head
Nikita 3 years ago
parent 072f7ef63b
commit 277c1eedbd

@ -9,6 +9,7 @@ import (
type File struct {
FileID string `json:"file_id"`
UniqueID string `json:"file_unique_id"`
FileName string `json:"file_name"`
FileSize int `json:"file_size"`
// file on telegram server https://core.telegram.org/bots/api#file

@ -50,6 +50,9 @@ type SendOptions struct {
// ParseMode controls how client apps render your message.
ParseMode ParseMode
// DisableContentDetection abilities to disable server-side file content type detection.
DisableContentDetection bool
}
func (og *SendOptions) copy() *SendOptions {

@ -1,13 +1,13 @@
package telebot
import (
"bytes"
"encoding/json"
"fmt"
"github.com/pkg/errors"
"log"
"net/http"
"strconv"
"bytes"
"github.com/pkg/errors"
)
func (b *Bot) debug(err error) {
@ -195,6 +195,10 @@ func (b *Bot) embedSendOptions(params map[string]string, opt *SendOptions) {
params["parse_mode"] = opt.ParseMode
}
if opt.DisableContentDetection {
params["disable_content_type_detection"] = "true"
}
if opt.ReplyMarkup != nil {
processButtons(opt.ReplyMarkup.InlineKeyboard)
replyMarkup, _ := json.Marshal(opt.ReplyMarkup)

Loading…
Cancel
Save