Export row type

pull/331/head
renanzxc 4 years ago committed by Demian
parent b51e06e25d
commit ad12779174

@ -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))
@ -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))

Loading…
Cancel
Save