tg/cmd/test/location.go

30 lines
540 B
Go

package main
import (
"surdeus.su/core/tg"
)
var LocationWidget = tg.RenderFunc(func(c tg.Context) tg.UI {
return tg.UI{
tg.Messagef(
"Press the button to display your counter",
).Inline(
tg.NewKeyboard().Row(
tg.Buttonf(
"Check",
).WithData(
"check",
).WithAction(tg.Func(func(c tg.Context) {
d := ExtractSessionData(c)
c.Sendf("Counter = %d", d.Counter)
})),
).Inline(),
),
tg.Messagef(
"Press the button to send your location!",
).Reply(
SendLocationKeyboard,
),
}
})