2023-10-11 14:20:25 +03:00
|
|
|
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
|
2023-10-11 14:20:25 +03:00
|
|
|
Location
|
|
|
|
}
|
|
|
|
|
|
|
|
func (compo *LocationCompo) SendConfig(
|
|
|
|
sid SessionId, bot *Bot,
|
2024-03-29 14:30:48 +03:00
|
|
|
) (SendConfig) {
|
2023-10-11 14:20:25 +03:00
|
|
|
cid := sid.ToApi()
|
2024-03-29 14:30:48 +03:00
|
|
|
location := tgbotapi.NewLocation(
|
2023-10-11 14:20:25 +03:00
|
|
|
cid,
|
|
|
|
compo.Latitude,
|
|
|
|
compo.Longitude,
|
|
|
|
)
|
2024-03-29 14:30:48 +03:00
|
|
|
|
|
|
|
ret := SendConfig{}
|
|
|
|
ret.Chattable = location
|
2023-10-11 14:20:25 +03:00
|
|
|
|
|
|
|
return ret
|
|
|
|
}
|
|
|
|
|