31 lines
561 B
Go
31 lines
561 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"vultras.su/core/tg"
|
||
|
)
|
||
|
|
||
|
var HomeButton = tg.Buttonf("Home").Go("/")
|
||
|
var BackButton = tg.Buttonf("Back").Go("-")
|
||
|
var BackKeyboard = tg.NewKeyboard().Row(
|
||
|
BackButton,
|
||
|
)
|
||
|
|
||
|
var SendLocationKeyboard = tg.NewKeyboard().Row(
|
||
|
tg.Buttonf("Send location").
|
||
|
WithSendLocation(true).
|
||
|
WithAction(tg.Func(func(c tg.Context) {
|
||
|
l := c.CallbackUpdate().Message.Location
|
||
|
c.Sendf(
|
||
|
"Longitude: %f\n"+
|
||
|
"Latitude: %f\n"+
|
||
|
"Heading: %d"+
|
||
|
"",
|
||
|
l.Longitude,
|
||
|
l.Latitude,
|
||
|
l.Heading,
|
||
|
)
|
||
|
})),
|
||
|
).Row(
|
||
|
BackButton,
|
||
|
).Reply()
|