Comment logs used to debug creation

This commit is contained in:
maximo tejeda 2025-02-23 09:58:23 -04:00
parent b8fa3d2594
commit 169937bebd

View File

@ -2,7 +2,6 @@ package helpers
import ( import (
"errors" "errors"
"fmt"
"github.com/go-telegram/bot/models" "github.com/go-telegram/bot/models"
) )
@ -34,7 +33,7 @@ func AddButton(ik *InlineKeyboard, text, data string) {
if len(r.Buttons) < r.Len { if len(r.Buttons) < r.Len {
button := Button{Text: text, Data: data} button := Button{Text: text, Data: data}
r.Buttons = append(r.Buttons, button) r.Buttons = append(r.Buttons, button)
fmt.Println("ADD BUTTON ", r, ik) // fmt.Println("ADD BUTTON ", r, ik)
}else { }else {
r = &Row{ r = &Row{
Len: r.Len, Len: r.Len,
@ -42,7 +41,7 @@ func AddButton(ik *InlineKeyboard, text, data string) {
} }
button := Button{Text: text, Data: data} button := Button{Text: text, Data: data}
r.Buttons = append(r.Buttons, button) r.Buttons = append(r.Buttons, button)
fmt.Println("ADD BUTTON ", r, ik) // fmt.Println("ADD BUTTON ", r, ik)
ik.Rows = append(ik.Rows, *r) ik.Rows = append(ik.Rows, *r)
@ -54,15 +53,15 @@ func AddButton(ik *InlineKeyboard, text, data string) {
func AddRow(ik *InlineKeyboard, len int){ func AddRow(ik *InlineKeyboard, len int){
row := &Row{Len: len, Buttons: []Button{}} row := &Row{Len: len, Buttons: []Button{}}
ik.Rows = append(ik.Rows, *row) ik.Rows = append(ik.Rows, *row)
fmt.Println("ADD Row ", row.Len) // fmt.Println("ADD Row ", row.Len)
} }
// CreateKeyBoard // CreateKeyBoard
// render the structure into a models.InlineKeyboardMarkup // render the structure into a models.InlineKeyboardMarkup
func (ik *InlineKeyboard) CreateKeyBoard()models.InlineKeyboardMarkup{ func (ik *InlineKeyboard) CreateKeyBoard()models.InlineKeyboardMarkup{
kbd := models.InlineKeyboardMarkup{} kbd := models.InlineKeyboardMarkup{}
fmt.Println("creating keyboard ---- ", fmt.Sprintf("%#v", ik)) // fmt.Println("creating keyboard ---- ", fmt.Sprintf("%#v", ik))
fmt.Println("row 0 ", ik.Rows[0]) // fmt.Println("row 0 ", ik.Rows[0])
for _, row := range ik.Rows { for _, row := range ik.Rows {
r := []models.InlineKeyboardButton{} r := []models.InlineKeyboardButton{}
for _, button := range row.Buttons{ for _, button := range row.Buttons{