2024-03-29 14:30:48 +03:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2024-05-15 20:41:53 +03:00
|
|
|
"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,
|
|
|
|
),
|
|
|
|
}
|
|
|
|
})
|