@@ -295,21 +295,51 @@ func (f *File) Link(token string) string {
295295 return fmt .Sprintf (FileEndpoint , token , f .FilePath )
296296}
297297
298+ var _ botkb.Keyboard = (* ReplyKeyboardMarkup )(nil )
299+ var _ Keyboard = (* ReplyKeyboardMarkup )(nil )
300+
298301// ReplyKeyboardMarkup allows the Bot to set a custom keyboard.
299302type ReplyKeyboardMarkup struct {
300- Keyboard [][]KeyboardButton `json:"keyboard"`
301- ResizeKeyboard bool `json:"resize_keyboard,omitempty"` // optional
302- OneTimeKeyboard bool `json:"one_time_keyboard,omitempty"` // optional
303- Selective bool `json:"selective,omitempty"` // optional
303+ // Array of button rows, each represented by an Array of KeyboardButton objects
304+ Keyboard [][]KeyboardButton `json:"keyboard"`
305+
306+ // Optional. Requests clients to always show the keyboard when the regular keyboard is hidden.
307+ // Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon.
308+ IsPersistent bool `json:"is_persistent,omitempty"`
309+
310+ // Optional. Requests clients to resize the keyboard vertically for optimal fit
311+ // (e.g., make the keyboard smaller if there are just two rows of buttons).
312+ // Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard.
313+ ResizeKeyboard bool `json:"resize_keyboard,omitempty"` // optional
314+
315+ // Optional. Requests clients to hide the keyboard as soon as it's been used.
316+ // The keyboard will still be available, but clients will automatically display the usual letter-keyboard
317+ // in the chat - the user can press a special button in the input field to see the custom keyboard again.
318+ //Defaults to false.
319+ OneTimeKeyboard bool `json:"one_time_keyboard,omitempty"` // optional
320+
321+ // Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters
322+ InputFieldPlaceholder string `json:"input_field_placeholder,omitempty"`
323+
324+ // Optional. Use this parameter if you want to show the keyboard to specific users only.
325+ // Targets:
326+ // 1) users that are @mentioned in the text of the Message object;
327+ // 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.
328+ //
329+ // Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language.
330+ // Other users in the group don't see the keyboard.
331+ Selective bool `json:"selective,omitempty"` // optional
332+ }
333+
334+ func (m * ReplyKeyboardMarkup ) telegramKeyboardType () keyboardType {
335+ return "reply_keyboard"
304336}
305337
306338// KeyboardType returns KeyboardTypeBottom
307339func (* ReplyKeyboardMarkup ) KeyboardType () botkb.KeyboardType {
308340 return botkb .KeyboardTypeBottom
309341}
310342
311- var _ botkb.Keyboard = (* ReplyKeyboardMarkup )(nil )
312-
313343// KeyboardButtonRequestUsers represents a request from the bot to send users
314344// https://core.telegram.org/bots/api#keyboardbuttonrequestusers
315345type KeyboardButtonRequestUsers struct {
@@ -435,24 +465,36 @@ func (v WebAppInfo) Validate() error {
435465 return nil
436466}
437467
468+ var _ botkb.Keyboard = (* ReplyKeyboardHide )(nil )
469+ var _ Keyboard = (* ReplyKeyboardHide )(nil )
470+
438471// ReplyKeyboardHide allows the Bot to hide a custom keyboard.
439472type ReplyKeyboardHide struct {
440473 HideKeyboard bool `json:"hide_keyboard"`
441474 Selective bool `json:"selective,omitempty"` // optional
442475}
443476
477+ func (h * ReplyKeyboardHide ) telegramKeyboardType () keyboardType {
478+ return "ReplyKeyboardHide"
479+ }
480+
444481// KeyboardType returns KeyboardTypeHide
445482func (* ReplyKeyboardHide ) KeyboardType () botkb.KeyboardType {
446483 return botkb .KeyboardTypeHide
447484}
448485
449- var _ botkb.Keyboard = (* ReplyKeyboardHide )(nil )
486+ var _ botkb.Keyboard = (* InlineKeyboardMarkup )(nil )
487+ var _ Keyboard = (* InlineKeyboardMarkup )(nil )
450488
451489// InlineKeyboardMarkup is a custom keyboard presented for an inline bot.
452490type InlineKeyboardMarkup struct {
453491 InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"`
454492}
455493
494+ func (v * InlineKeyboardMarkup ) telegramKeyboardType () keyboardType {
495+ return "InlineKeyboardMarkup"
496+ }
497+
456498func (v * InlineKeyboardMarkup ) Validate () error {
457499 for _ , row := range v .InlineKeyboard {
458500 for _ , button := range row {
@@ -469,8 +511,6 @@ func (*InlineKeyboardMarkup) KeyboardType() botkb.KeyboardType {
469511 return botkb .KeyboardTypeInline
470512}
471513
472- var _ botkb.Keyboard = (* InlineKeyboardMarkup )(nil )
473-
474514// LoginUrl represents a parameter of the inline keyboard button used to automatically authorize a user.
475515// https://core.telegram.org/bots/api#loginurl
476516type LoginUrl struct {
0 commit comments