How to make ReplyKeyboardMarkup with telegram-bot-api Golang

Viewed 52

Only one information I found is closed thread from 2015 with problem in library. There was a piece of code

itemsSel := [][]string{}
itemsSel = append(itemsSel, []string{item1.Caption, item2.Caption, item3.Caption})

msg := tgbotapi.NewMessage(update.Message.Chat.ID, "Select item")
msg.ReplyMarkup = &tgbotapi.ReplyKeyboardMarkup{
    Keyboard:       itemsSel,
    ResizeKeyboard: true,
    OneTimeKeyboard: false,
    Selective:       false,
}

log.Println(msg.ReplyMarkup)

msg.ReplyToMessageID = update.Message.MessageID
bot.Send(msg)

There is some description of tgbotapi.ReplyKeyboardMarkup object, but there is a matrix of KeyboardButton objects as it is written on https://core.telegram.org/bots/api#replykeyboardmarkup. How to make this object, I don't know. Help me :3

0 Answers
Related