tg/location.go

30 lines
426 B
Go
Raw Permalink Normal View History

package tg
import (
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
)
type Location = tgbotapi.Location
type LocationCompo struct {
2024-03-29 14:30:48 +03:00
MessageCompo
Location
}
func (compo *LocationCompo) SendConfig(
sid SessionID, bot *Bot,
2024-03-29 14:30:48 +03:00
) (SendConfig) {
cid := sid.ToAPI()
2024-03-29 14:30:48 +03:00
location := tgbotapi.NewLocation(
cid,
compo.Latitude,
compo.Longitude,
)
2024-03-29 14:30:48 +03:00
ret := SendConfig{}
ret.Chattable = location
return ret
}