tg/cmd/test/location.go
2024-03-29 16:30:48 +05:00

34 lines
586 B
Go

package main
import (
"vultras.su/core/tg"
)
const (
LocationPath tg.Path = "location"
)
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,
),
}
})