Merge pull request #485 from setval/support-5.6

api: support 5.6
pull/497/head
demget 2 years ago committed by GitHub
commit 9849ae0f18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -25,6 +25,9 @@ const (
// AllowWithoutReply = SendOptions.AllowWithoutReply
AllowWithoutReply
// Protected = SendOptions.Protected
Protected
// ForceReply = ReplyMarkup.ForceReply
ForceReply
@ -74,6 +77,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.

@ -160,6 +160,8 @@ func extractOptions(how []interface{}) *SendOptions {
opts.ReplyMarkup = &ReplyMarkup{}
}
opts.ReplyMarkup.RemoveKeyboard = true
case Protected:
opts.Protected = true
default:
panic("telebot: unsupported flag-option")
}
@ -220,6 +222,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