content: add protect params

pull/485/head
Nikita 2 years ago
parent 1cfc31f074
commit c277d8daf0

@ -74,6 +74,9 @@ type SendOptions struct {
// AllowWithoutReply allows sending messages not a as reply if the replied-to message has already been deleted.
AllowWithoutReply bool
// Protects the contents of the sent message from forwarding and saving
Protected bool
}
func (og *SendOptions) copy() *SendOptions {

@ -182,6 +182,7 @@ const (
EntityCode EntityType = "code"
EntityCodeBlock EntityType = "pre"
EntityTextLink EntityType = "text_link"
EntitySpoiler EntityType = "spoiler"
)
// ChatType represents one of the possible chat types.

@ -220,6 +220,10 @@ func (b *Bot) embedSendOptions(params map[string]string, opt *SendOptions) {
replyMarkup, _ := json.Marshal(opt.ReplyMarkup)
params["reply_markup"] = string(replyMarkup)
}
if opt.Protected {
params["protect_content"] = "true"
}
}
func processButtons(keys [][]InlineButton) {

Loading…
Cancel
Save