Skip to content

Commit f54e994

Browse files
Add callback and reply types documentation
1 parent bf143a9 commit f54e994

File tree

1 file changed

+36
-8
lines changed

1 file changed

+36
-8
lines changed

types.go

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -865,20 +865,48 @@ type InlineKeyboardButton struct {
865865
// CallbackQuery is data sent when a keyboard button with callback data
866866
// is clicked.
867867
type CallbackQuery struct {
868-
ID string `json:"id"`
869-
From *User `json:"from"`
870-
Message *Message `json:"message"` // optional
871-
InlineMessageID string `json:"inline_message_id"` // optional
872-
ChatInstance string `json:"chat_instance"`
873-
Data string `json:"data"` // optional
874-
GameShortName string `json:"game_short_name"` // optional
868+
// ID unique identifier for this query
869+
ID string `json:"id"`
870+
// From sender
871+
From *User `json:"from"`
872+
// Message with the callback button that originated the query.
873+
// Note that message content and message date will not be available if the message is too old.
874+
//
875+
// optional
876+
Message *Message `json:"message"`
877+
// InlineMessageID identifier of the message sent via the bot in inline mode, that originated the query.
878+
//
879+
// optional
880+
//
881+
InlineMessageID string `json:"inline_message_id"`
882+
// ChatInstance global identifier, uniquely corresponding to the chat to which
883+
// the message with the callback button was sent. Useful for high scores in games.
884+
//
885+
ChatInstance string `json:"chat_instance"`
886+
// Data associated with the callback button. Be aware that
887+
// a bad client can send arbitrary data in this field.
888+
//
889+
// optional
890+
Data string `json:"data"`
891+
// GameShortName short name of a Game to be returned, serves as the unique identifier for the game.
892+
//
893+
// optional
894+
GameShortName string `json:"game_short_name"`
875895
}
876896

877897
// ForceReply allows the Bot to have users directly reply to it without
878898
// additional interaction.
879899
type ForceReply struct {
900+
// ForceReply shows reply interface to the user,
901+
// as if they manually selected the bot's message and tapped 'Reply'.
880902
ForceReply bool `json:"force_reply"`
881-
Selective bool `json:"selective"` // optional
903+
// Selective use this parameter if you want to force reply from specific users only.
904+
// Targets:
905+
// 1) users that are @mentioned in the text of the Message object;
906+
// 2) if the bot's message is a reply (has Message.ReplyToMessage not nil), sender of the original message.
907+
//
908+
// optional
909+
Selective bool `json:"selective"`
882910
}
883911

884912
// ChatMember is information about a member in a chat.

0 commit comments

Comments
 (0)