Export row type

pull/341/head
renanzxc 4 years ago committed by Demian
parent 66f939ca14
commit 8fe81bb3bf

@ -162,13 +162,15 @@ func (pt PollType) MarshalJSON() ([]byte, error) {
return json.Marshal(&aux)
}
type row []Btn
// Row represents an array of buttons, a row
type Row []Btn
func (r *ReplyMarkup) Row(many ...Btn) row {
// Row create a row of buttons
func (r *ReplyMarkup) Row(many ...Btn) Row {
return many
}
func (r *ReplyMarkup) Inline(rows ...row) {
func (r *ReplyMarkup) Inline(rows ...Row) {
inlineKeys := make([][]InlineButton, 0, len(rows))
for i, row := range rows {
keys := make([]InlineButton, 0, len(row))
@ -187,7 +189,7 @@ func (r *ReplyMarkup) Inline(rows ...row) {
r.InlineKeyboard = inlineKeys
}
func (r *ReplyMarkup) Reply(rows ...row) {
func (r *ReplyMarkup) Reply(rows ...Row) {
replyKeys := make([][]ReplyButton, 0, len(rows))
for i, row := range rows {
keys := make([]ReplyButton, 0, len(row))

Loading…
Cancel
Save