commit
369364b8c6
20
helpers.go
20
helpers.go
|
@ -421,8 +421,8 @@ func NewEditMessageCaption(chatID int64, messageID int, caption string) EditMess
|
||||||
func NewEditMessageReplyMarkup(chatID int64, messageID int, replyMarkup InlineKeyboardMarkup) EditMessageReplyMarkupConfig {
|
func NewEditMessageReplyMarkup(chatID int64, messageID int, replyMarkup InlineKeyboardMarkup) EditMessageReplyMarkupConfig {
|
||||||
return EditMessageReplyMarkupConfig{
|
return EditMessageReplyMarkupConfig{
|
||||||
BaseEdit: BaseEdit{
|
BaseEdit: BaseEdit{
|
||||||
ChatID: chatID,
|
ChatID: chatID,
|
||||||
MessageID: messageID,
|
MessageID: messageID,
|
||||||
ReplyMarkup: &replyMarkup,
|
ReplyMarkup: &replyMarkup,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -466,9 +466,7 @@ func NewKeyboardButtonLocation(text string) KeyboardButton {
|
||||||
func NewKeyboardButtonRow(buttons ...KeyboardButton) []KeyboardButton {
|
func NewKeyboardButtonRow(buttons ...KeyboardButton) []KeyboardButton {
|
||||||
var row []KeyboardButton
|
var row []KeyboardButton
|
||||||
|
|
||||||
for _, button := range buttons {
|
row = append(row, buttons...)
|
||||||
row = append(row, button)
|
|
||||||
}
|
|
||||||
|
|
||||||
return row
|
return row
|
||||||
}
|
}
|
||||||
|
@ -477,9 +475,7 @@ func NewKeyboardButtonRow(buttons ...KeyboardButton) []KeyboardButton {
|
||||||
func NewReplyKeyboard(rows ...[]KeyboardButton) ReplyKeyboardMarkup {
|
func NewReplyKeyboard(rows ...[]KeyboardButton) ReplyKeyboardMarkup {
|
||||||
var keyboard [][]KeyboardButton
|
var keyboard [][]KeyboardButton
|
||||||
|
|
||||||
for _, row := range rows {
|
keyboard = append(keyboard, rows...)
|
||||||
keyboard = append(keyboard, row)
|
|
||||||
}
|
|
||||||
|
|
||||||
return ReplyKeyboardMarkup{
|
return ReplyKeyboardMarkup{
|
||||||
ResizeKeyboard: true,
|
ResizeKeyboard: true,
|
||||||
|
@ -518,9 +514,7 @@ func NewInlineKeyboardButtonSwitch(text, sw string) InlineKeyboardButton {
|
||||||
func NewInlineKeyboardRow(buttons ...InlineKeyboardButton) []InlineKeyboardButton {
|
func NewInlineKeyboardRow(buttons ...InlineKeyboardButton) []InlineKeyboardButton {
|
||||||
var row []InlineKeyboardButton
|
var row []InlineKeyboardButton
|
||||||
|
|
||||||
for _, button := range buttons {
|
row = append(row, buttons...)
|
||||||
row = append(row, button)
|
|
||||||
}
|
|
||||||
|
|
||||||
return row
|
return row
|
||||||
}
|
}
|
||||||
|
@ -529,9 +523,7 @@ func NewInlineKeyboardRow(buttons ...InlineKeyboardButton) []InlineKeyboardButto
|
||||||
func NewInlineKeyboardMarkup(rows ...[]InlineKeyboardButton) InlineKeyboardMarkup {
|
func NewInlineKeyboardMarkup(rows ...[]InlineKeyboardButton) InlineKeyboardMarkup {
|
||||||
var keyboard [][]InlineKeyboardButton
|
var keyboard [][]InlineKeyboardButton
|
||||||
|
|
||||||
for _, row := range rows {
|
keyboard = append(keyboard, rows...)
|
||||||
keyboard = append(keyboard, row)
|
|
||||||
}
|
|
||||||
|
|
||||||
return InlineKeyboardMarkup{
|
return InlineKeyboardMarkup{
|
||||||
InlineKeyboard: keyboard,
|
InlineKeyboard: keyboard,
|
||||||
|
|
Loading…
Reference in New Issue