Skip to content

Commit

Permalink
Export row type
Browse files Browse the repository at this point in the history
  • Loading branch information
renanzxc authored and demget committed Nov 3, 2020
1 parent b51e06e commit ad12779
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,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))
Expand All @@ -185,7 +187,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))
Expand Down

0 comments on commit ad12779

Please sign in to comment.