Add callback and reply types documentation

bot-api-6.1
Ilya Kaznacheev 2020-10-24 16:52:22 +03:00
parent bf143a9e9b
commit f54e99475a
No known key found for this signature in database
GPG Key ID: 7E2C1D8A4AB37D50
1 changed files with 36 additions and 8 deletions

View File

@ -865,20 +865,48 @@ type InlineKeyboardButton struct {
// CallbackQuery is data sent when a keyboard button with callback data // CallbackQuery is data sent when a keyboard button with callback data
// is clicked. // is clicked.
type CallbackQuery struct { type CallbackQuery struct {
// ID unique identifier for this query
ID string `json:"id"` ID string `json:"id"`
// From sender
From *User `json:"from"` From *User `json:"from"`
Message *Message `json:"message"` // optional // Message with the callback button that originated the query.
InlineMessageID string `json:"inline_message_id"` // optional // Note that message content and message date will not be available if the message is too old.
//
// optional
Message *Message `json:"message"`
// InlineMessageID identifier of the message sent via the bot in inline mode, that originated the query.
//
// optional
//
InlineMessageID string `json:"inline_message_id"`
// ChatInstance global identifier, uniquely corresponding to the chat to which
// the message with the callback button was sent. Useful for high scores in games.
//
ChatInstance string `json:"chat_instance"` ChatInstance string `json:"chat_instance"`
Data string `json:"data"` // optional // Data associated with the callback button. Be aware that
GameShortName string `json:"game_short_name"` // optional // a bad client can send arbitrary data in this field.
//
// optional
Data string `json:"data"`
// GameShortName short name of a Game to be returned, serves as the unique identifier for the game.
//
// optional
GameShortName string `json:"game_short_name"`
} }
// ForceReply allows the Bot to have users directly reply to it without // ForceReply allows the Bot to have users directly reply to it without
// additional interaction. // additional interaction.
type ForceReply struct { type ForceReply struct {
// ForceReply shows reply interface to the user,
// as if they manually selected the bot's message and tapped 'Reply'.
ForceReply bool `json:"force_reply"` ForceReply bool `json:"force_reply"`
Selective bool `json:"selective"` // optional // Selective use this parameter if you want to force reply from specific users only.
// Targets:
// 1) users that are @mentioned in the text of the Message object;
// 2) if the bot's message is a reply (has Message.ReplyToMessage not nil), sender of the original message.
//
// optional
Selective bool `json:"selective"`
} }
// ChatMember is information about a member in a chat. // ChatMember is information about a member in a chat.