35 lines
586 B
Go
35 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,
|
||
|
),
|
||
|
}
|
||
|
})
|