tg/cmd/test/location.go

31 lines
540 B
Go
Raw Permalink Normal View History

2024-03-29 14:30:48 +03:00
package main
import (
"surdeus.su/core/tg"
2024-03-29 14:30:48 +03:00
)
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,
),
}
})